Repository navigation
Description
Several fixed-work benchmarks in #383 show repeatable gaps against other Rust implementations. This issue tracks one independently reviewable investigation per primitive. Pick a sub-issue and post the workload, machine and first measurement you plan to investigate. Reproductions on another platform, allocation counts and profiles are useful first contributions.
Pick a workload
| Sub-issue | First contribution |
|---|---|
| #397 WaitGroup | Independently reproduce the candidate on another host. |
| #398 OnceCell | Count allocations on the first initialization and measure an already initialized read. |
| #399 LazyCell | Compare a stored factory and a stored ready future on their first shared force. |
| #400 Semaphore | Repeat the same handoff on fresh and reused semaphores. |
| #401 Bounded MPSC | Profile moving the same 1 KiB payload inline and through a Box. |
| #402 Unbounded MPMC broadcast | Separate per-message Arc cost from contention between readers. |
| #403 Mutex | Measure the last permit release with an empty wait queue. |
| #404 UpgradableRwLock | Measure acquiring the upgradable guard separately from promoting it. |
The OnceCell, LazyCell, Mutex and upgradable-lock workloads share semaphore or mutex code. Coordinate queue changes in #400 and measure the affected consumer rows. PR #394 examines the size of acquisition futures. PR #395 contains a WaitGroup candidate that would benefit from independent measurements.
Measuring an improvement
Use the same payload, observable behavior, round count and executor configuration on both sides. Run each adapter 10 times with rotating order and report the median in milliseconds for the whole batch. Include the commit, Rust version, OS, CPU and exact command. Record the same figures for the baseline, candidate and peers, and repeat a focused launch when rankings are close. Ecosystem measurements and MPSC repeats
The measurements use the optimized Cargo bench profile on an Apple M4 Max with rustc 1.101.0-nightly. The supplemental comparison target was built in a disposable checkout at 6102089. Its generator and commands are published with the results. The benchmark workloads and library sources match merge commit 36ba6f2. Supplemental comparisons and all 245 Asyncband baselines
The capacity-1024, one-producer usize MPSC workload changed winners on repeat. The bounded MPSC sub-issue tracks the separate capacity-64, four-producer inline 1 KiB case, where all four libraries kept their ranking across both runs.
A completed sub-issue should identify a measured cost, demonstrate a repeatable improvement or document why the peer's performance depends on a different contract. Check the relevant contended, cancellation or already initialized control before closing. For WaitGroup, track the two original completion cases against waitgroup and validate the candidate already in #395.
Activity
ismaeelakin commentedon Nov 3, 2026
I ran these benchmarks on Windows 11 (Intel Core i5-6300U, 2 cores / 4 threads), using rustc 1.99.1 at commit
36ba6f27c5003524c10fd348720c34825122ca87. Each used 8.3 million rounds and 10 repetitions.upgradable_read_reuse: 947 ms median (929–1,051 ms)upgradable_read_then_upgrade: 1,516 ms median (1,484–1,645 ms)The second case includes acquisition and promotion. The 569 ms difference between medians is only a rough estimate of promotion cost, not a direct timing.
Commands:
cargo x bench --bench primitives -- upgradable_read_reuse --rounds 8300000 --repeat 10 --raw;cargo x bench --bench primitives -- upgradable_read_then_upgrade --rounds 8300000 --repeat 10 --raw.