Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Slowness from prepareWantHaves #392

Closed
whyrusleeping opened this issue May 15, 2020 · 6 comments · Fixed by #395
Closed

Slowness from prepareWantHaves #392

whyrusleeping opened this issue May 15, 2020 · 6 comments · Fixed by #395
Labels
need/triage Needs initial labeling and prioritization

Comments

@whyrusleeping
Copy link
Member

I'm seeing 'BroadcastWantHaves' from the peer manager showing up in profiles, spending time iterating maps inside of prepareBroadcastWantHaves. We can probably optimize this a bit

@whyrusleeping whyrusleeping added the need/triage Needs initial labeling and prioritization label May 15, 2020
@welcome
Copy link

welcome bot commented May 15, 2020

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@whyrusleeping
Copy link
Member Author

This is inside of filecoin, where pretty much every peer has every single object. So i imagine hundreds of peers are going to have the objects in question.

Additionally, it looks like we're making this whole map just to iterate over it in the caller. Maybe we can avoid these allocations somehow?

@dirkmc
Copy link
Contributor

dirkmc commented May 15, 2020

We were seeing some issues with that code path on the IPFS gateways. Do you have a pprof dump?

@dirkmc
Copy link
Contributor

dirkmc commented May 15, 2020

@whyrusleeping points out that we may be able to avoid a bunch of allocations by modifying prepareBroadcastWantHaves() to take a callback instead of returning a map

@Stebalien
Copy link
Member

Make sure you're using sessions.

@dirkmc
Copy link
Contributor

dirkmc commented May 15, 2020

haha gave him that tip already :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants