perf(p2p/conn): Remove unneeded global pool buffers in secret connection#3403
perf(p2p/conn): Remove unneeded global pool buffers in secret connection#3403
Conversation
|
(The govulncheck failure is unrelated, just a dependency update that needs to happen) |
cason
left a comment
There was a problem hiding this comment.
Great work, simple change, probably high improvement.
But from the code it seems that we did not even need a pool of buffers, synchronized or not, but just a single buffer? Amazing that who implemented that did not realize it.
.changelog/unreleased/improvements/3403-remove-pool-buffer-usage-in-secretconn.md
Outdated
Show resolved
Hide resolved
|
I renamed the changelog entry and PR title to |
|
Ah, you forgot to run |
…ge-in-secretconn.md Co-authored-by: Daniel <daniel.cason@informal.systems>
Yup, haha.
Thank you! I forgot its based on package, hopefully will correct better for subsequent PRs!
Wow, nice consequence of this |
…ion (#3403) Closes #3197 Remove unneeded global pool buffers in secret connection, instead just use a byte slice per secret connection, and just once for all packet sends. This is a 15% improvement to Secret connection's CPU time in Write, and 8% to read We have much bigger system bottlenecks to fix (in the same RecvRoutine and SendRoutine calls), but this felt very low-lift, hence making the PR. --- #### PR checklist - [X] Tests written/updated - N/A - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Daniel <daniel.cason@informal.systems> (cherry picked from commit d335255) # Conflicts: # .changelog/v0.38.8/improvements/3403-remove-pool-buffer-usage-in-secretconn.md # go.mod # go.sum # p2p/conn/secret_connection.go
|
Should we backport to v1 also? |
|
yes please! |
|
@mergify backport v1.x |
✅ Backports have been createdDetails
|
|
@mergify backport v0.37.x |
✅ Backports have been createdDetails
|
…ion (#3403) Closes #3197 Remove unneeded global pool buffers in secret connection, instead just use a byte slice per secret connection, and just once for all packet sends. This is a 15% improvement to Secret connection's CPU time in Write, and 8% to read We have much bigger system bottlenecks to fix (in the same RecvRoutine and SendRoutine calls), but this felt very low-lift, hence making the PR. --- #### PR checklist - [X] Tests written/updated - N/A - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Daniel <daniel.cason@informal.systems> (cherry picked from commit d335255) # Conflicts: # .changelog/v0.37.7/improvements/3403-remove-pool-buffer-usage-in-secretconn.md # go.mod # go.sum # p2p/conn/secret_connection.go
…ion (#3403) Closes #3197 Remove unneeded global pool buffers in secret connection, instead just use a byte slice per secret connection, and just once for all packet sends. This is a 15% improvement to Secret connection's CPU time in Write, and 8% to read We have much bigger system bottlenecks to fix (in the same RecvRoutine and SendRoutine calls), but this felt very low-lift, hence making the PR. --- #### PR checklist - [X] Tests written/updated - N/A - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Daniel <daniel.cason@informal.systems> (cherry picked from commit d335255)
…ion (backport #3403) (#3428) Closes #3197 Remove unneeded global pool buffers in secret connection, instead just use a byte slice per secret connection, and just once for all packet sends. This is a 15% improvement to Secret connection's CPU time in Write, and 8% to read We have much bigger system bottlenecks to fix (in the same RecvRoutine and SendRoutine calls), but this felt very low-lift, hence making the PR. --- #### PR checklist - [X] Tests written/updated - N/A - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #3403 done by [Mergify](https://mergify.com). Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
…ion (backport #3403) (#3427) Closes #3197 Remove unneeded global pool buffers in secret connection, instead just use a byte slice per secret connection, and just once for all packet sends. This is a 15% improvement to Secret connection's CPU time in Write, and 8% to read We have much bigger system bottlenecks to fix (in the same RecvRoutine and SendRoutine calls), but this felt very low-lift, hence making the PR. --- #### PR checklist - [X] Tests written/updated - N/A - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #3403 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> Co-authored-by: Hernán Vanzetto <15466498+hvanz@users.noreply.github.com>
…ion (backport #3403) (#3418) Closes #3197 Remove unneeded global pool buffers in secret connection, instead just use a byte slice per secret connection, and just once for all packet sends. This is a 15% improvement to Secret connection's CPU time in Write, and 8% to read We have much bigger system bottlenecks to fix (in the same RecvRoutine and SendRoutine calls), but this felt very low-lift, hence making the PR. --- #### PR checklist - [X] Tests written/updated - N/A - [X] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [X] Updated relevant documentation (`docs/` or `spec/`) and code comments - [X] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request #3403 done by [Mergify](https://mergify.com). --------- Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com> Co-authored-by: Hernán Vanzetto <15466498+hvanz@users.noreply.github.com>
Closes #3197
Remove unneeded global pool buffers in secret connection, instead just use a byte slice per secret connection, and just once for all packet sends. This is a 15% improvement to Secret connection's CPU time in Write, and 8% to read
We have much bigger system bottlenecks to fix (in the same RecvRoutine and SendRoutine calls), but this felt very low-lift, hence making the PR.
PR checklist
.changelog(we use unclog to manage our changelog)docs/orspec/) and code comments