Page MenuHomePhabricator

[avalanche] Improve performance of inventory filtering
ClosedPublic

Authored by Fabien on Tue, Mar 18, 15:32.

Details

Reviewers
roqqit
PiRK
Group Reviewers
Restricted Project
Commits
rABC88dc412d3367: [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

Diff Detail

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