Skip to content

bench(fast_io): io_uring SQPOLL vs regular submission vs std::fs (#1626) - #4201

Merged
oferchen merged 3 commits into
masterfrom
bench/iouring-sqpoll-vs-regular-1626
May 17, 2026
Merged

oferchen merged 3 commits into
masterfrom
bench/iouring-sqpoll-vs-regular-1626

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add crates/fast_io/benches/iouring_sqpoll_vs_regular.rs: a Linux-only Criterion bench that writes 100K x 4 KiB files via three I/O dispatch styles (synchronous std::fs, io_uring regular submission, io_uring with IORING_SETUP_SQPOLL) so the receiver hot path can be evaluated against each style at a high submission rate.
  • Wire the bench into crates/fast_io/Cargo.toml with required-features = [\"io_uring\"]; non-Linux targets compile to a stub main.
  • All SQPOLL setup lives inside the bench file; no new production paths are introduced in fast_io.

Design notes

  • Two env-var gates: OC_RSYNC_BENCH_IOURING_RING=1 enables the two io_uring groups, OC_RSYNC_BENCH_IOURING_SQPOLL=1 additionally enables the SQPOLL group (SQPOLL needs CAP_SYS_NICE on pre-5.13 kernels). Without either gate the bench prints a skip line and exits 0.
  • The submission helper is shared between the regular and SQPOLL groups; the only difference is how the ring is constructed (IoUring::new vs IoUring::builder().setup_sqpoll(..)), so any throughput delta is attributable to submission style rather than ring topology.
  • Top-of-file module doc records the hypothesis, the run recipe, the kernel-version matrix, and what favourable / unfavourable numbers inform on Guard env mutations in fallback tests #2243 (per-file vs shared ring) and Align cross-compile matrix with build_daemon metadata #2045 (registered-buffer adaptive sizing). The defensive SQPOLL refusal added in Update Homebrew formula for v3.4.1-rust #2158 is cross-referenced.
  • Throughput reported via Throughput::Elements(100_000) so the three rows compare directly without unit conversion.

Test plan

  • cargo bench -p fast_io --bench iouring_sqpoll_vs_regular (no env vars) prints two skip lines and a stdfs row on Linux.
  • OC_RSYNC_BENCH_IOURING_RING=1 cargo bench -p fast_io --bench iouring_sqpoll_vs_regular runs stdfs and iouring_regular, skips iouring_sqpoll.
  • OC_RSYNC_BENCH_IOURING_RING=1 OC_RSYNC_BENCH_IOURING_SQPOLL=1 cargo bench -p fast_io --bench iouring_sqpoll_vs_regular on a 5.13+ kernel runs all three groups.
  • macOS / Windows CI: cargo bench -p fast_io --bench iouring_sqpoll_vs_regular --no-run compiles to the stub main.

oferchen added 3 commits May 17, 2026 07:32
Add a Linux-only Criterion bench that writes 100K x 4 KiB files three
ways - synchronous std::fs::write_all, io_uring with default per-batch
io_uring_enter, and io_uring with IORING_SETUP_SQPOLL - so the receiver
hot path can be evaluated against each dispatch style at a high
submission rate.

The SQPOLL group is gated behind a second env var
(OC_RSYNC_BENCH_IOURING_SQPOLL) on top of the shared
OC_RSYNC_BENCH_IOURING_RING gate because SQPOLL needs CAP_SYS_NICE on
pre-5.13 kernels. Non-Linux targets compile to a stub main so the bench
is safe to register unconditionally. All SQPOLL setup lives inside the
bench file; no new production paths are introduced in fast_io.
io_uring 0.7 made IoUring generic over the SQE type. The bench
needed explicit Entry annotation to disambiguate.
@oferchen
oferchen merged commit 50c569e into master May 17, 2026
40 checks passed
@oferchen
oferchen deleted the bench/iouring-sqpoll-vs-regular-1626 branch May 17, 2026 06:53
oferchen added a commit that referenced this pull request May 18, 2026
…) (#4201)

* bench(fast_io): io_uring SQPOLL vs regular submission vs std::fs (#1626)

Add a Linux-only Criterion bench that writes 100K x 4 KiB files three
ways - synchronous std::fs::write_all, io_uring with default per-batch
io_uring_enter, and io_uring with IORING_SETUP_SQPOLL - so the receiver
hot path can be evaluated against each dispatch style at a high
submission rate.

The SQPOLL group is gated behind a second env var
(OC_RSYNC_BENCH_IOURING_SQPOLL) on top of the shared
OC_RSYNC_BENCH_IOURING_RING gate because SQPOLL needs CAP_SYS_NICE on
pre-5.13 kernels. Non-Linux targets compile to a stub main so the bench
is safe to register unconditionally. All SQPOLL setup lives inside the
bench file; no new production paths are introduced in fast_io.

* style(fast_io): apply rustfmt to iouring_sqpoll_vs_regular bench

* fix(fast_io): annotate IoUring entry type in sqpoll bench

io_uring 0.7 made IoUring generic over the SQE type. The bench
needed explicit Entry annotation to disambiguate.
oferchen added a commit that referenced this pull request May 18, 2026
…) (#4201)

* bench(fast_io): io_uring SQPOLL vs regular submission vs std::fs (#1626)

Add a Linux-only Criterion bench that writes 100K x 4 KiB files three
ways - synchronous std::fs::write_all, io_uring with default per-batch
io_uring_enter, and io_uring with IORING_SETUP_SQPOLL - so the receiver
hot path can be evaluated against each dispatch style at a high
submission rate.

The SQPOLL group is gated behind a second env var
(OC_RSYNC_BENCH_IOURING_SQPOLL) on top of the shared
OC_RSYNC_BENCH_IOURING_RING gate because SQPOLL needs CAP_SYS_NICE on
pre-5.13 kernels. Non-Linux targets compile to a stub main so the bench
is safe to register unconditionally. All SQPOLL setup lives inside the
bench file; no new production paths are introduced in fast_io.

* style(fast_io): apply rustfmt to iouring_sqpoll_vs_regular bench

* fix(fast_io): annotate IoUring entry type in sqpoll bench

io_uring 0.7 made IoUring generic over the SQE type. The bench
needed explicit Entry annotation to disambiguate.
oferchen added a commit that referenced this pull request Aug 24, 2026
…) (#4201)

* bench(fast_io): io_uring SQPOLL vs regular submission vs std::fs (#1626)

Add a Linux-only Criterion bench that writes 100K x 4 KiB files three
ways - synchronous std::fs::write_all, io_uring with default per-batch
io_uring_enter, and io_uring with IORING_SETUP_SQPOLL - so the receiver
hot path can be evaluated against each dispatch style at a high
submission rate.

The SQPOLL group is gated behind a second env var
(OC_RSYNC_BENCH_IOURING_SQPOLL) on top of the shared
OC_RSYNC_BENCH_IOURING_RING gate because SQPOLL needs CAP_SYS_NICE on
pre-5.13 kernels. Non-Linux targets compile to a stub main so the bench
is safe to register unconditionally. All SQPOLL setup lives inside the
bench file; no new production paths are introduced in fast_io.

* style(fast_io): apply rustfmt to iouring_sqpoll_vs_regular bench

* fix(fast_io): annotate IoUring entry type in sqpoll bench

io_uring 0.7 made IoUring generic over the SQE type. The bench
needed explicit Entry annotation to disambiguate.
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