Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi: Use an APBF for per peer known addrs. #2583

Merged
merged 1 commit into from
Feb 8, 2021

Commits on Feb 8, 2021

  1. multi: Use an APBF for per peer known addrs.

    This modifies the server to track the per peer known addresses using a
    much more efficient APBF instead of an LRU cache which has significant
    overhead in addition to having to store the entirety of all items added
    to it.
    
    False positives are acceptable as the goal is to avoid sending duplicate
    addresses which is an ideal case for APBFs.
    
    More concretely, the current LRU cache that stores the known addresses
    can grow to around 1.69 MiB *per peer* when full while the new APBF only
    takes around 40 KiB, a reduction of around 97.7%, while exhibiting
    roughly the same computational performance.
    
    Since there is a maximum of 125 peers by default, that means the current
    LRU cache can potentially grow to around ~211 MiB if fully populated for
    max peers.  The new APBF, on the other hand, will only consume ~4.88 MiB
    under the same scenario.
    davecgh committed Feb 8, 2021
    Configuration menu
    Copy the full SHA
    1512058 View commit details
    Browse the repository at this point in the history