Page MenuHomePhabricator

[electrum] Performance: make receive_history_callback faster for larger histories
ClosedPublic

Authored by PiRK on Oct 30 2023, 12:45.

Details

Summary

The current code was doing very slow ops -- effectively O(n^2) lookups for
large histories, to detect no-longer-in-history txns. We instead use
CPython native implementation of the frozenset difference operator to
accomplish the same thing and turn the operation into O(n).

This is a backport of https://github.com/Electron-Cash/Electron-Cash/commit/c2b697a4c0d0d2243ad553f6916d43751c262966

Depends on D14784

Test Plan

Receive a transaction and check if the history list still works.

pytest electrumabc/tests/regtest/

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK edited the summary of this revision. (Show Details)
PiRK edited the test plan for this revision. (Show Details)

rebase on D14784

PiRK published this revision for review.Nov 14 2023, 16:05
This revision is now accepted and ready to land.Nov 14 2023, 22:27