8000 perf(p2p/channel): Speedup NewDelimitedWriter (backport #2949) by mergify[bot] · Pull Request #2968 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

perf(p2p/channel): Speedup NewDelimitedWriter (backport #2949) #2968

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

Merged
merged 1 commit into from
May 2, 2024

Conversation

mergify[bot]
Copy link
Contributor
@mergify mergify bot commented May 2, 2024

Speeds up 5% of the non-IO time overhead from channel.WritePacketMsgTo. The CPU time overhead in this function is quite significant, CPU time is more than 3 times the syscall time for writing to the net buffer. Working on a github issue for more substantial refactor / time eliminations, but this 3s is easy enough.

We don't even use this codepath, so this make slice is entirely wasted. However we should do things that reduce this overhead further.

image


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 #2949 done by [Mergify](https://mergify.com).

Speeds up 5% of the non-IO time overhead from
`channel.WritePacketMsgTo`. The CPU time overhead in this function is
quite significant, CPU time is more than 3 times the syscall time for
writing to the net buffer. Working on a github issue for more
substantial refactor / time eliminations, but this 3s is easy enough.

We don't even use this codepath, so this make slice is entirely wasted.
However we should do things that reduce this overhead further.

![image](https://github.com/cometbft/cometbft/assets/6440154/e02e45bf-d6ff-4e11-9983-e81ca1102dc8)

---

#### PR checklist

- [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 8162aa2)
@mergify mergify bot requested a review from a team as a code owner May 2, 2024 12:12
@melekes melekes merged commit 58627a5 into v0.38.x May 2, 2024
21 checks passed
@melekes melekes deleted the mergify/bp/v0.38.x/pr-2949 branch May 2, 2024 12:19
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
0