HomePhabricator

[avalanche] Improve performance of inventory filtering

Description

[avalanche] Improve performance of inventory filtering

Summary:
The various isWorthPolling() functions (one for each inventory kind) are actually called before checking the recently finalized bloom filter, which means that we always spend time in the variant selection then the inventory filtering function even if the item is trivially not worth polling because it's already final. The bloom filter check is very cheap, so let's do that first and bypass the more expensive algorithm if possible.

There is no change in behavior.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, roqqit, PiRK

Reviewed By: #bitcoin_abc, roqqit, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D17817

Details

Provenance
FabienAuthored on Tue, Mar 18, 15:31
FabienPushed on Tue, Mar 18, 17:14
Reviewer
Restricted Project
Differential Revision
D17817: [avalanche] Improve performance of inventory filtering
Parents
rABCf7b0bdf7c762: [electrum] Fix typo in trezor firmware warning text
Branches
Unknown
Tags
Unknown