Skip to content

perf(jmux,jetsocat): reuse sender flush timer - #1909

Merged
Benoît Cortier (CBenoit) merged 1 commit into
masterfrom
cbenoit-performance-improvements
Aug 5, 2026
Merged

perf(jmux,jetsocat): reuse sender flush timer#1909
Benoît Cortier (CBenoit) merged 1 commit into
masterfrom
cbenoit-performance-improvements

Conversation

@CBenoit

Copy link
Copy Markdown
Member

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 5, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@CBenoit
Benoît Cortier (CBenoit) enabled auto-merge (squash) August 5, 2026 07:47
@CBenoit Benoît Cortier (CBenoit) changed the title perf(jmux): reuse sender flush timer perf(jmux,jetsocat): reuse sender flush timer Aug 5, 2026
@CBenoit
Benoît Cortier (CBenoit) enabled auto-merge (squash) August 5, 2026 07:48
@CBenoit
Benoît Cortier (CBenoit) merged commit 9f9313d into master Aug 5, 2026
45 checks passed
@CBenoit
Benoît Cortier (CBenoit) deleted the cbenoit-performance-improvements branch August 5, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants