libp2p / go-libp2p-pubsub

The PubSub implementation for go-libp2p
https://github.com/libp2p/specs/tree/master/pubsub
Other
313 stars 179 forks source link

perf: use msgio pooled buffers for received msgs #500

Closed Wondertan closed 1 year ago

Wondertan commented 1 year ago

The issue mentions only receiving buffers, so this PR only changes those. However, there might be value in changing sending buffers as well. Happy to update this in a subsequent commit if needed.

Closes #350

Wondertan commented 1 year ago

@vyzo, any interest in this?

vyzo commented 1 year ago

ah sorry, didnt notice it. Can you tag me for review in future prs?

vyzo commented 1 year ago

@Wondertan ping

vyzo commented 1 year ago

Also, lets do send buffers while at it; it can be a separate pr.

Wondertan commented 1 year ago

ah sorry, didnt notice it.

nw, someone has to make FVM sound 😉

Wondertan commented 1 year ago

ping

@vyzo, done

Also, lets do send buffers while at it; it can be a separate pr.

👌🏻

Wondertan commented 1 year ago

Also, updated handlePeerEOF to use msgio

vyzo commented 1 year ago

@Wondertan ping -- lets move this forward?

Wondertan commented 1 year ago

@vyzo, I am currently on the two-week team onsite, and it's almost the end. Going to bring this over the finish line right after.

The are some unanswered questions in the thread, IIRC

vyzo commented 1 year ago

yeah, whenever you can.

I think reverting the eof change for now, or releasing the buffer, will do for merge.

But lets create a follow up issue to discuss the general handling and come up with a good solution that can later be speced for other impls to follow.

Wondertan commented 1 year ago

@vyzo, so I reverted the EOF change and started making an issue for it. Now it's only the reading side with pooled buffers. I can also try to squeeze in the write today if we want to.

Wondertan commented 1 year ago

@vyzo, see https://github.com/libp2p/go-libp2p-pubsub/issues/506