perf(jmux,jetsocat): reuse sender flush timer - #1909
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Optimizes JMUX sender batching by reusing its debounce timer while preserving trailing flush behavior.
Changes:
- Introduces a shared 10 ms flush-delay constant.
- Reuses and resets one pinned Tokio timer per sender task.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Benoît Cortier (CBenoit)
enabled auto-merge (squash)
August 5, 2026 07:47
Benoît Cortier (CBenoit)
disabled auto-merge
August 5, 2026 07:48
Benoît Cortier (CBenoit)
enabled auto-merge (squash)
August 5, 2026 07:48
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The JMUX sender created a new Tokio sleep future for every queued packet before its debounce flush. Under sustained message traffic, that timer churn adds avoidable runtime overhead.
Reuse and reset one pinned 10 ms timer instead. The sender retains its trailing debounce behavior: it flushes 10 ms after the most recently received message.
A saturated send-loop microbenchmark on Tokio 1.52.3 reduced median timer-management cost from 221.3 ns to 121.6 ns per iteration. This measures timer overhead only, not end-to-end JMUX throughput.