Skip to content

perf(p2p/conn): Remove a minint call that was appearing in write packet delays (backport #2952)#2973

Merged
melekes merged 2 commits intov1.xfrom
mergify/bp/v1.x/pr-2952
May 2, 2024
Merged

perf(p2p/conn): Remove a minint call that was appearing in write packet delays (backport #2952)#2973
melekes merged 2 commits intov1.xfrom
mergify/bp/v1.x/pr-2952

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented May 2, 2024

Somehow this minint call is appearing in CPU profiles. Its too large of an appearance to be declared as noise, but I really don't get why its there. Must be some weird system effect I don't get. (perhaps due to being the result of a function call for a slice index? idk)

This PR just removes the function call, since its not needed, as we already branch on the if statement.

Profile showing it:
image

Contributes a 3% improvement to #2951


PR checklist

  • Tests written/updated - fully compatible with what already exists
  • 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 #2952 done by [Mergify](https://mergify.com).

…et delays (#2952)

Somehow this minint call is appearing in CPU profiles. Its too large of
an appearance to be declared as noise, but I really don't get why its
there. Must be some weird system effect I don't get. (perhaps due to
being the result of a function call for a slice index? idk)

This PR just removes the function call, since its not needed, as we
already branch on the if statement.

Profile showing it:

![image](https://github.com/cometbft/cometbft/assets/6440154/a12c8918-e4ce-4a3d-bad4-5ae678988f94)

Contributes a 3% improvement to #2951

---

#### PR checklist

- [x] Tests written/updated - fully compatible with what already exists
- [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 fbf5c60)
@mergify mergify bot requested a review from a team as a code owner May 2, 2024 12:30
@mergify mergify bot requested a review from a team May 2, 2024 12:30
@melekes melekes merged commit 194d5bc into v1.x May 2, 2024
@melekes melekes deleted the mergify/bp/v1.x/pr-2952 branch May 2, 2024 12:59
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