Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

High CPU usage in AddAddrs #26

Closed
Stebalien opened this issue Mar 26, 2018 · 2 comments
Closed

High CPU usage in AddAddrs #26

Stebalien opened this issue Mar 26, 2018 · 2 comments
Labels
need/community-input Needs input from the wider community optimization

Comments

@Stebalien
Copy link
Member

Stebalien commented Mar 26, 2018

So, #22 gave us a really nice win in terms of memory usage but, unfortunately, given the insane number of addresses we're currently tracking, is now causing CPU problems.

Two solutions:

  1. Limit the number of addresses we store per peer. Unfortunately, this could make it difficult to connect to some peers. Ideally, peers would sign their peer address records but that will require some work. Regardless, we should do this anyways.
  2. Make this function faster. Unfortunately, given that @whyrusleeping has been dragging his feet on make Multiaddr a newtype of []bytes multiformats/go-multiaddr#63 and/or store Multiaddrs as strings and don't use interfaces multiformats/go-multiaddr#62, pretty much all reasonably efficient algorithms for merging multiaddr sets require copying.
@whyrusleeping
Copy link
Contributor

Unfortunately, given that @whyrusleeping has been dragging his feet on...

Sheesh, fine. I'll go review those

@Stebalien
Copy link
Member Author

This hotspot appears to have been fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/community-input Needs input from the wider community optimization
Projects
None yet
Development

No branches or pull requests

3 participants