Skip to content

Benchmark post-smol rsloop against pre-migration, uvloop and zuvloop - #102

Closed
egorsmkv wants to merge 2 commits into
masterfrom
bench/smol-paired-comparison
Closed

egorsmkv wants to merge 2 commits into
masterfrom
bench/smol-paired-comparison

Conversation

@egorsmkv

@egorsmkv egorsmkv commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

PR #101 changed the Rust async bridge and blocking runtime without measuring throughput or latency. Add a paired benchmark workflow that measures the checked-out current rsloop, immediate pre-migration master (56d0ebd), historical benchmark revision (43f624a), uvloop 0.22.1 and zuvloop 0.0.17 afresh.

Each CPython 3.14.0 / 3.14.0t job builds isolated locked release wheels and runs every candidate sequentially on the same runner and CPU. Two fresh-process warmups and nine randomized paired trials cover 1M callbacks, 200K tasks and 20K TCP round trips. A separate instrumented TCP workload records median/p95/p99 RTT without changing the throughput workload. Native imports must preserve the expected GIL state; unavailable or incompatible loops fail instead of being silently skipped.

The full comparison has now completed on the Linux host ml-lab2 (Intel Core i9-9900K, successful io_uring_setup). All six exact-revision release wheels built; 440 fresh worker processes completed, including 360 measured trials. The measured current wheel is the original PR head b02ab6a, with the corrected RSS harness.

Paired median current/pre change GIL Free-threaded
Callback duration +1.01% +0.94%
Task duration +0.54% +2.39%
TCP workload duration -2.33% +1.08%
TCP median RTT -0.87% +1.84%

Peak RSS is nearly unchanged. Small timing differences and paired ranges do not establish a general smol improvement or regression; these are single-CPU measurements with frequency scaling and SMT enabled.

Fix peak RSS accounting in the paired harness: Linux getrusage().ru_maxrss can retain memory from before exec, inflating fresh workers' results. Read /proc/self/status VmHWM instead, record the source in worker metadata, and add a regression check. The initial run using the inherited counter was discarded; both reported suites use the corrected harness.

Host report includes interpretation and attribution limits. Checked-in evidence preserves all raw trials and 2.2M individual RTT samples in compressed JSONL, exact refs, harness hashes, Python/package/compiler/CPU metadata, dependency freezes, paired deltas, build logs and SHA-256 checksums. Existing docs/benchmarks.md is preserved.

Validation: five statistics/RSS regression checks pass on both CPython 3.14.0 and 3.14.0t; Ruff check/format, Pyright (0 errors), git diff --check, artifact checksum verification, and all full benchmark workers pass. Every worker preserved the expected GIL state and CPU affinity; all 440 raw records and RTT sample counts were checked.

@egorsmkv egorsmkv closed this Oct 9, 2026
@egorsmkv
egorsmkv deleted the bench/smol-paired-comparison branch October 11, 2026 09:24
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