Repository navigation
bench(fast_io): io_uring SQPOLL vs regular submission vs std::fs (#1626) - #4201
Merged
Merged
Conversation
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.
This was referenced May 17, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 (synchronousstd::fs, io_uring regular submission, io_uring withIORING_SETUP_SQPOLL) so the receiver hot path can be evaluated against each style at a high submission rate.crates/fast_io/Cargo.tomlwithrequired-features = [\"io_uring\"]; non-Linux targets compile to a stubmain.fast_io.Design notes
OC_RSYNC_BENCH_IOURING_RING=1enables the two io_uring groups,OC_RSYNC_BENCH_IOURING_SQPOLL=1additionally enables the SQPOLL group (SQPOLL needsCAP_SYS_NICEon pre-5.13 kernels). Without either gate the bench prints a skip line and exits 0.IoUring::newvsIoUring::builder().setup_sqpoll(..)), so any throughput delta is attributable to submission style rather than ring topology.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 astdfsrow on Linux.OC_RSYNC_BENCH_IOURING_RING=1 cargo bench -p fast_io --bench iouring_sqpoll_vs_regularrunsstdfsandiouring_regular, skipsiouring_sqpoll.OC_RSYNC_BENCH_IOURING_RING=1 OC_RSYNC_BENCH_IOURING_SQPOLL=1 cargo bench -p fast_io --bench iouring_sqpoll_vs_regularon a 5.13+ kernel runs all three groups.cargo bench -p fast_io --bench iouring_sqpoll_vs_regular --no-runcompiles to the stubmain.