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
Branch
avalanche_isworthpolling_bypasss
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32753
Build 64994: Build Difflint-circular-dependencies · build-without-wallet · build-diff · build-clang-tidy · build-clang · build-debug
Build 64993: arc lint + arc unit