Two compile fixes: - tokio_favored.rs bench_mpsc_smarm: consumer spawn closure returned u64 via bare 'count' tail expression; smarm::Runtime::run() requires FnOnce()->(). Fixed to 'let _ = count;'. Same fix on the consumer.join() call site. - smarm_favored.rs bench_unc_smarm: same pattern, same fix. Baseline run: Intel Xeon @ 2.80GHz, 1 core, kernel 6.18.5, rustc 1.95.0, smarm 0.3.0, no RUSTFLAGS. Single-CPU sandbox — N-thread rows identical to 1-thread; scaling sweep limited to 1 thread. Notable findings: - deep_recursion: tokio wins (22 vs 62 us); mmap stack alloc cost dominates for single-use actors at depth 500. - yield_in_hot_loop: tokio wins (138 vs 182 ms); smarm mutex overhead on yield_now exceeds expected naked-switch advantage on 1 CPU. - mpsc_contention/uncontended_channel/catch_unwind_panics: smarm wins as predicted. - spawn_storm_busy: smarm 47x slower; global mutex saturated by bg yielders.
45 lines
2.9 KiB
Plaintext
45 lines
2.9 KiB
Plaintext
smarm general benchmarks
|
||
available parallelism: 1 threads
|
||
ITERS=15 (+1 warmup, discarded)
|
||
CHAIN_DEPTH=1000, YIELD_TASKS=200×1000, PRIME_N=400000/64 workers, PP_ROUNDS=1000
|
||
|
||
================================================================================
|
||
chained_spawn: depth 1000
|
||
================================================================================
|
||
runtime | result | median µs | min µs | max µs
|
||
--------------------------------------------------------------------------------
|
||
smarm 1-thread | 1000 | 7136 | 6929 | 8347
|
||
smarm 1-thread | 1000 | 6979 | 6790 | 7364
|
||
tokio current_thread | 1000 | 113 | 112 | 322
|
||
tokio multi-thread | 1000 | 176 | 170 | 355
|
||
|
||
================================================================================
|
||
yield_many: 200 tasks × 1000 yields
|
||
================================================================================
|
||
runtime | result | median µs | min µs | max µs
|
||
--------------------------------------------------------------------------------
|
||
smarm 1-thread | 200000 | 40079 | 39606 | 41913
|
||
smarm 1-thread | 200000 | 40073 | 39298 | 43173
|
||
tokio current_thread | 200000 | 14571 | 14430 | 14670
|
||
tokio multi-thread | 200000 | 14044 | 13306 | 14432
|
||
|
||
================================================================================
|
||
fan_out_compute: primes in [2, 400000) across 64
|
||
================================================================================
|
||
runtime | result | median µs | min µs | max µs
|
||
--------------------------------------------------------------------------------
|
||
smarm 1-thread | 33860 | 19347 | 19185 | 19703
|
||
smarm 1-thread | 33860 | 19461 | 19202 | 21172
|
||
tokio current_thread | 33860 | 18616 | 18553 | 18987
|
||
tokio multi-thread | 33860 | 18905 | 18755 | 19035
|
||
|
||
================================================================================
|
||
ping_pong_oneshot: 1000 rounds
|
||
================================================================================
|
||
runtime | result | median µs | min µs | max µs
|
||
--------------------------------------------------------------------------------
|
||
smarm 1-thread | 1000 | 13731 | 13555 | 15545
|
||
smarm 1-thread | 1000 | 14176 | 13870 | 14892
|
||
tokio current_thread | 1000 | 828 | 788 | 939
|
||
tokio multi-thread | 1000 | 3342 | 3233 | 3624
|