bench(fast_io): IOCP vs io_uring under matched workloads (#1868)#4255
Merged
Conversation
Add a matched-workload benchmark that drives both kernel-async write paths (IocpDiskBatch on Windows, IoUringDiskBatch on Linux) against the same payload sizes (4 KiB / 64 KiB / 1 MiB), file count (1000), and per-iteration temp-dir lifecycle. Each host also runs a std_baseline cell so per-host throughput can be normalised before cross-host comparison; the two kernels cannot be compared directly.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Add a matched-workload benchmark that drives both kernel-async write paths (IocpDiskBatch on Windows, IoUringDiskBatch on Linux) against the same payload sizes (4 KiB / 64 KiB / 1 MiB), file count (1000), and per-iteration temp-dir lifecycle. Each host also runs a std_baseline cell so per-host throughput can be normalised before cross-host comparison; the two kernels cannot be compared directly.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Add a matched-workload benchmark that drives both kernel-async write paths (IocpDiskBatch on Windows, IoUringDiskBatch on Linux) against the same payload sizes (4 KiB / 64 KiB / 1 MiB), file count (1000), and per-iteration temp-dir lifecycle. Each host also runs a std_baseline cell so per-host throughput can be normalised before cross-host comparison; the two kernels cannot be compared directly.
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/iocp_vs_iouring_matched.rs: a matched-workload bench that drivesIocpDiskBatchon Windows andIoUringDiskBatchon Linux through identical payload sizes (4 KiB / 64 KiB / 1 MiB), file counts (1000), per-iteration temp-dir lifecycles, and a deterministic 4 KiB tiled payload pattern.std_baselinecell that usesFile::create+write_allso per-host throughput can be normalised before any cross-host comparison. The two kernels cannot be compared head-to-head; the normalised ratio is the cross-platform signal.iocp_vs_iouring_matchedincrates/fast_io/Cargo.tomlwithharness = false. The bench file compiles on every platform; non-target-OS bodies fall back to thestd_baseline-only group so Criterion'sharness = falsecontract holds everywhere.Cells per platform
all(target_os = "linux", feature = "io_uring")):iouring_default,iouring_concurrent_ops_8(sq_entries = 8),iouring_sqpoll(sqpoll = true),std_baseline. The io_uring cells are env-gated viaOC_RSYNC_BENCH_IOURING_RING=1; the SQPOLL cell additionally requiresOC_RSYNC_BENCH_IOURING_SQPOLL=1, matching the existingiouring_sqpoll_vs_regular.rsrecipe.all(target_os = "windows", feature = "iocp")):iocp_default,iocp_concurrent_ops_8(concurrent_ops = 8),std_baseline.std_baselineonly.Normalisation approach
Divide each platform-specific cell's throughput by that host's
std_baselinethroughput for the same payload size, then compare the resulting ratios across the Linux and Windows runs. The ratio strips out host-specific storage stack effects so the residual delta reflects the kernel-async dispatch style itself. This is documented in the bench file's module doc with a worked example.Test plan
OC_RSYNC_BENCH_IOURING_RING=1 cargo bench -p fast_io --bench iocp_vs_iouring_matchedproduces all four Linux cells.cargo bench -p fast_io --bench iocp_vs_iouring_matchedproduces all three Windows cells.std_baselinecells.