Skip to content

perf(p2p): Reduce the p2p metrics overhead. (backport #3411)#3569

Merged
melekes merged 1 commit intov1.xfrom
mergify/bp/v1.x/pr-3411
Jul 27, 2024
Merged

perf(p2p): Reduce the p2p metrics overhead. (backport #3411)#3569
melekes merged 1 commit intov1.xfrom
mergify/bp/v1.x/pr-3411

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Jul 26, 2024

Closes #2840

We do this, by the calls to Prometheus (which have many allocations) to be significantly batched, and importantly not blocking the send routine and recv routine.

This is a 25% speedup to recvRoutine, and 60% speedup to peer.Send.

By napkin estimate, this also saves 8% of newObject call time, which hopefully also means over 8% of the GC overhead times


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments
  • Title follows the Conventional Commits spec

This is an automatic backport of pull request #3411 done by [Mergify](https://mergify.com).

Closes #2840

We do this, by the calls to Prometheus (which have many allocations) to
be significantly batched, and importantly not blocking the send routine
and recv routine.

This is a 25% speedup to recvRoutine, and 60% speedup to peer.Send.

By napkin estimate, this also saves 8% of newObject call time, which
hopefully also means over 8% of the GC overhead times

<!--

Please add a reference to the issue that this PR addresses and indicate
which
files are most critical to review. If it fully addresses a particular
issue,
please include "Closes #XXX" (where "XXX" is the issue number).

If this PR is non-trivial/large/complex, please ensure that you have
either
created an issue that the team's had a chance to respond to, or had some
discussion with the team prior to submitting substantial pull requests.
The team
can be reached via GitHub Discussions or the Cosmos Network Discord
server in
the #cometbft channel. GitHub Discussions is preferred over Discord as
it
allows us to keep track of conversations topically.
https://github.com/cometbft/cometbft/discussions

If the work in this PR is not aligned with the team's current
priorities, please
be advised that it may take some time before it is merged - especially
if it has
not yet been discussed with the team.

See the project board for the team's current priorities:
https://github.com/orgs/cometbft/projects/1

-->

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [ ] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Daniel <daniel.cason@informal.systems>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
(cherry picked from commit 94d42a9)
@mergify mergify bot requested a review from a team as a code owner July 26, 2024 13:34
@mergify mergify bot requested a review from a team July 26, 2024 13:34
@melekes melekes merged commit 672aa13 into v1.x Jul 27, 2024
@melekes melekes deleted the mergify/bp/v1.x/pr-3411 branch July 27, 2024 04:17
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