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

common/gossip_store: optimize case where entries are filtered out. #5328

Merged

Commits on Jun 20, 2022

  1. common/gossip_store: optimize case where entries are filtered out.

    @whitslack complained of large CPU usage by connectd at startup;
    I ran perf record on connectd on my machine (which sees a little spike, only)
    and I see the cost of reading and discarding the entries:
    
    ```
    -   95.52%     5.24%  lightning_conne  lightning_connectd  [.] gossip_store_next
       - 90.28% gossip_store_next
          + 40.27% tal_alloc_arr_
          + 22.78% tal_free
          + 11.74% crc32c
          + 9.32% fromwire_peektype
          + 4.10% __libc_pread64 (inlined)
            1.70% be32_to_cpu
    ```
    
    Much of this is caused by the search for our own gossip: keeping this separately
    would be even better, but this fix is minimal.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Fixed: connectd: reduce initial CPU load when connecting to peers.
    rustyrussell committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    b28adf1 View commit details
    Browse the repository at this point in the history