Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(consensus): Reuse an internal buffer for block building (#3162) (backport #99) #100

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jun 4, 2024

Makes an internal buffer that we can re-use when building blocks. This seems to save on average 75 microseconds per block for osmosis blocks. (Ranging between 1-2 block parts in the relevant time range) This should be scaling roughly linear with block size.

This lets us remove one allocation cost per complete block coming in. We only need to re-allocate on the next "biggest ever seen" block we see.


  • 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

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

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

…t#3162)

<!--

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

-->

Makes an internal buffer that we can re-use when building blocks. This
seems to save on average 75 microseconds per block for osmosis blocks.
(Ranging between 1-2 block parts in the relevant time range) This should
be scaling roughly linear with block size.

This lets us remove one allocation cost per complete block coming in. We
only need to re-allocate on the next "biggest ever seen" block we see.

---

- [x] Tests written/updated
- [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

(cherry picked from commit 16839d8)
@ValarDragon ValarDragon merged commit 56626cf into osmo-v25/v0.37.4 Jun 4, 2024
15 of 16 checks passed
@ValarDragon ValarDragon deleted the mergify/bp/osmo-v25/v0.37.4/pr-99 branch June 4, 2024 13:41
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.

1 participant