Open guillaumemichel opened 1 year ago
the libp2p endpoint doesn't yet make use of sync.Pool to optimize memory allocations when writing/reading messages to/from a libp2p stream. This seems to be an easy performance improvement.
sync.Pool
go-libp2p-kad-dht is using sync.Pool (see https://github.com/libp2p/go-libp2p-kad-dht/blob/978cb74f5fdf846e09d5769bb4dfb9f962135c38/internal/net/message_manager.go#L360-L368)
https://github.com/plprobelab/go-kademlia/blob/main/network/endpoint/libp2pendpoint/libp2pendpoint.go
Will move issue to go-libp2p-kad-dht for KadDHT in v2
the libp2p endpoint doesn't yet make use of
sync.Pool
to optimize memory allocations when writing/reading messages to/from a libp2p stream. This seems to be an easy performance improvement.go-libp2p-kad-dht is using
sync.Pool
(see https://github.com/libp2p/go-libp2p-kad-dht/blob/978cb74f5fdf846e09d5769bb4dfb9f962135c38/internal/net/message_manager.go#L360-L368)References
https://github.com/plprobelab/go-kademlia/blob/main/network/endpoint/libp2pendpoint/libp2pendpoint.go