Bitswap client CPU hotspots
- Dominant language
- Go
- Stars
- 316
- Forks
- 163
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 8
Description
# Goals
Under heavy load, we're seeing high CPU usage in Lassie originating in Bitswap. Looks like a couple functions are pretty heavy CPU consumers:
- `SessionInterestManager.RemoveSession`
- `MessageQueue.ExtractOutgoingMessage` (and `Wantlist.Entries` within it)
This pushes us towards 700%+ CPU usage on a Saturn node that affects overall performance.
Pprof visualization:

Source data:
[cpu.pprof.zip](https://github.com/ipfs/boxo/files/11444857/cpu.pprof.zip)
Lassie binaries (this is from the x86_64 build we think):
https://github.com/filecoin-project/lassie/releases/tag/v0.9.2
I suspect these hotspots are pretty common to heavy bitswap client usage and are worth optimizing.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.