Skip to content

perf: reduce fan-out notification overhead - #266

Merged
tisonkun merged 2 commits into
apache:mainfrom
tisonkun:codex/optimize-waker-batches
Sep 2, 2026
Merged

perf: reduce fan-out notification overhead#266
tisonkun merged 2 commits into
apache:mainfrom
tisonkun:codex/optimize-waker-batches

Conversation

@tisonkun

@tisonkun tisonkun commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Separate reusable waiter draining from terminal take_all, moving terminal arena scanning and destruction outside the state lock.
  • Share an inline-one WakerBatch across wait-set, event, condition-variable, and semaphore fan-out paths without adding a dependency.
  • Keep reusable paths retaining their arena allocation and use take_all only for terminal completion or disconnection transitions.

Design Notes

  • Interleaved Completion benchmarks show 10.5%–13.0% lower end-to-end latency for 1–8 waiters and 4.2% for 32 waiters.
  • An inline-eight SmallVec prototype improved larger fan-out but did not justify a new dependency or a bespoke unsafe collection without production fan-out evidence, so this change keeps the focused inline-one representation.

Validation

  • cargo x check
  • cargo x test
  • cargo x lint

@tisonkun
tisonkun merged commit bfdfd03 into apache:main Sep 2, 2026
10 checks passed
@tisonkun
tisonkun deleted the codex/optimize-waker-batches branch September 2, 2026 11:29
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