Skip to content

peerstore: remove sync.Pool for expiringAddrs - #3093

Merged
MarcoPolo merged 2 commits into
masterfrom
sukun/peerstore-no-pool
Dec 17, 2024
Merged

MarcoPolo merged 2 commits into
masterfrom
sukun/peerstore-no-pool

Conversation

@sukunrt

@sukunrt sukunrt commented Dec 8, 2024 •

Copy link
Copy Markdown
Member

depends on #3092

My intuition here was way off. The method spends most of the time either doing multiaddr ops or manipulating the heap(see the flamegraph). We don't need the sync.Pool. There's only a 5% difference without the pool.

goos: linux
goarch: amd64
pkg: github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem
cpu: AMD Ryzen 7 7840U w/ Radeon  780M Graphics     
                                          β”‚   old.txt   β”‚              new.txt               β”‚
                                          β”‚   sec/op    β”‚   sec/op     vs base               β”‚
InMemoryPeerstore/GetAndClearAddrs-1-16     8.351Β΅ Β± 2%   8.711Β΅ Β± 6%  +4.31% (p=0.019 n=10)
InMemoryPeerstore/GetAndClearAddrs-10-16    49.04Β΅ Β± 1%   49.75Β΅ Β± 1%  +1.45% (p=0.000 n=10)
InMemoryPeerstore/GetAndClearAddrs-100-16   462.6Β΅ Β± 1%   495.5Β΅ Β± 3%  +7.10% (p=0.000 n=10)
geomean                                     57.44Β΅        59.88Β΅       +4.26%

addrbook-bm

@sukunrt
sukunrt requested a review from MarcoPolo December 8, 2024 08:52
@sukunrt sukunrt self-assigned this Dec 9, 2024
@p-shahi p-shahi mentioned this pull request Dec 16, 2024
10 of 26 tasks
@sukunrt
sukunrt changed the base branch from sukun/peerstore-bms to master December 17, 2024 22:33
@sukunrt
sukunrt force-pushed the sukun/peerstore-no-pool branch from 7569dfa to 5f9c1fe Compare December 17, 2024 23:12
@MarcoPolo
MarcoPolo merged commit e959b3c into master Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants