Repository navigation
bench(fast_io): NVMe data path stdlib vs io_uring (#2364) - #4381
Merged
Merged
Conversation
3 tasks done
oferchen
force-pushed
the
bench/iud-nvme-data-path
branch
from
May 18, 2026 00:12
5b343db to
468ed70
Compare
Add a Linux-only Criterion bench that quantifies the headroom the iouring-data-writes cutover would close on a real NVMe mount. Two cells exercise the same 10 x 1 GiB workload through the production write paths: - stdlib_write: today's Writer::Buffered fallback (BufWriter, 256 KiB, one flush + sync_all at end-of-file). - iouring_write_fixed: IORING_OP_WRITE_FIXED against a four-slot registered-buffer pool of 1 MiB page-aligned buffers, followed by IORING_OP_FSYNC, matching the production IoUringDiskBatch::commit_file placement. Gated by OC_RSYNC_BENCH_NVME_DATA_PATH=1 because each iteration writes 10 GiB to disk. OC_RSYNC_BENCH_NVME_PATH optionally pins the scratch dir to a real NVMe mount; falls back to the default TempDir location (typically a ramdisk on CI) so the bench still produces a ring-lifecycle and submission-cost number when no NVMe is available. The bench is cfg-gated on target_os = "linux" + feature = "io_uring"; macOS, Windows, and feature-off builds compile to a stub main that prints a skip line. perf stat instructions are documented in the module doc rather than wired into the bench so Criterion's wall-time and throughput reporting stays clean.
oferchen
force-pushed
the
bench/iud-nvme-data-path
branch
from
May 18, 2026 00:58
468ed70 to
fb5f4bc
Compare
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Add a Linux-only Criterion bench that quantifies the headroom the iouring-data-writes cutover would close on a real NVMe mount. Two cells exercise the same 10 x 1 GiB workload through the production write paths: - stdlib_write: today's Writer::Buffered fallback (BufWriter, 256 KiB, one flush + sync_all at end-of-file). - iouring_write_fixed: IORING_OP_WRITE_FIXED against a four-slot registered-buffer pool of 1 MiB page-aligned buffers, followed by IORING_OP_FSYNC, matching the production IoUringDiskBatch::commit_file placement. Gated by OC_RSYNC_BENCH_NVME_DATA_PATH=1 because each iteration writes 10 GiB to disk. OC_RSYNC_BENCH_NVME_PATH optionally pins the scratch dir to a real NVMe mount; falls back to the default TempDir location (typically a ramdisk on CI) so the bench still produces a ring-lifecycle and submission-cost number when no NVMe is available. The bench is cfg-gated on target_os = "linux" + feature = "io_uring"; macOS, Windows, and feature-off builds compile to a stub main that prints a skip line. perf stat instructions are documented in the module doc rather than wired into the bench so Criterion's wall-time and throughput reporting stays clean.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Add a Linux-only Criterion bench that quantifies the headroom the iouring-data-writes cutover would close on a real NVMe mount. Two cells exercise the same 10 x 1 GiB workload through the production write paths: - stdlib_write: today's Writer::Buffered fallback (BufWriter, 256 KiB, one flush + sync_all at end-of-file). - iouring_write_fixed: IORING_OP_WRITE_FIXED against a four-slot registered-buffer pool of 1 MiB page-aligned buffers, followed by IORING_OP_FSYNC, matching the production IoUringDiskBatch::commit_file placement. Gated by OC_RSYNC_BENCH_NVME_DATA_PATH=1 because each iteration writes 10 GiB to disk. OC_RSYNC_BENCH_NVME_PATH optionally pins the scratch dir to a real NVMe mount; falls back to the default TempDir location (typically a ramdisk on CI) so the bench still produces a ring-lifecycle and submission-cost number when no NVMe is available. The bench is cfg-gated on target_os = "linux" + feature = "io_uring"; macOS, Windows, and feature-off builds compile to a stub main that prints a skip line. perf stat instructions are documented in the module doc rather than wired into the bench so Criterion's wall-time and throughput reporting stays clean.
1 task
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Add a Linux-only Criterion bench that quantifies the headroom the iouring-data-writes cutover would close on a real NVMe mount. Two cells exercise the same 10 x 1 GiB workload through the production write paths: - stdlib_write: today's Writer::Buffered fallback (BufWriter, 256 KiB, one flush + sync_all at end-of-file). - iouring_write_fixed: IORING_OP_WRITE_FIXED against a four-slot registered-buffer pool of 1 MiB page-aligned buffers, followed by IORING_OP_FSYNC, matching the production IoUringDiskBatch::commit_file placement. Gated by OC_RSYNC_BENCH_NVME_DATA_PATH=1 because each iteration writes 10 GiB to disk. OC_RSYNC_BENCH_NVME_PATH optionally pins the scratch dir to a real NVMe mount; falls back to the default TempDir location (typically a ramdisk on CI) so the bench still produces a ring-lifecycle and submission-cost number when no NVMe is available. The bench is cfg-gated on target_os = "linux" + feature = "io_uring"; macOS, Windows, and feature-off builds compile to a stub main that prints a skip line. perf stat instructions are documented in the module doc rather than wired into the bench so Criterion's wall-time and throughput reporting stays clean.
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
Adds a Linux-only Criterion bench that quantifies the headroom the
iouring-data-writescutover (docs/design/iouring-receive-data-path.md) would close on a real NVMe mount. Companion to the IUD-1 audit confirming most receive data already flows through io_uring; this bench measures what is left.Two cells, same 10 x 1 GiB workload:
stdlib_write: today'sWriter::Bufferedfallback.BufWriterwith the production 256 KiB capacity, one 1 MiBwrite_allper chunk,flush+sync_allat end-of-file.iouring_write_fixed: the proposed production path for files >= 1 MiB.IORING_OP_WRITE_FIXEDagainst a four-slot registered-buffer pool of 1 MiB page-aligned buffers, followed byIORING_OP_FSYNCmatchingIoUringDiskBatch::commit_file(do_fsync = true).Both cells write the same total bytes and run the same fsync cadence so the wall-time / MiB/s delta is attributable strictly to dispatch style.
Gating
OC_RSYNC_BENCH_NVME_DATA_PATH=1to opt in (each iter writes 10 GiB).OC_RSYNC_BENCH_NVME_PATH=/mnt/nvme/scratchoptional, pins the scratch dir to a real NVMe mount. Falls back to defaultTempDir(typically ramdisk on CI) so the bench still produces a ring-lifecycle / submission-cost number when no NVMe is available.cfg(all(target_os = "linux", feature = "io_uring")); macOS / Windows / feature-off builds compile to a stubmainthat prints a skip line.perf statinvocation documented in the module doc; not wired into the bench so Criterion's wall-time and throughput reporting stays clean.Test plan
cargo fmt --all -- --checkcargo clippy -p fast_io --all-targets --all-features --no-deps -- -D warningscargo bench -p fast_io --bench nvme_data_pathon a non-Linux host -> skip line, exit 0cargo bench -p fast_io --bench nvme_data_path --no-default-features-> skip line, exit 0OC_RSYNC_BENCH_NVME_DATA_PATH=1 cargo bench -p fast_io --bench nvme_data_pathon Linux 5.6+ -> two cells report bytes/sec