bench(fast_io): platform copy fast-path gap across Linux/macOS/Windows (#1386)#4258
Merged
Conversation
#1386) Adds platform_copy_gap, a single bench file that runs DefaultPlatformCopy on every host (FICLONE/copy_file_range on Linux, clonefile/fcopyfile on macOS, CopyFileExW/ReFS reflink on Windows) against std::fs::copy. Each host produces a platform_copy/std_baseline ratio per cell; the ratio is the kernel-fast-path win on that host and is the unit that can be compared across hosts. Records the chosen CopyMethod per cell on stderr so the Criterion report can be cross-referenced to the actual syscall. Cells: 4 KiB/64 KiB/1 MiB (100 files), 16 MiB (10 files), 256 MiB (2 files), sized so no cell exceeds ~30 s wall-clock on a typical CI runner. Independent of the kernel-async IOCP-vs-io_uring bench (#1868) which exercises a different syscall family.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
#1386) (#4258) Adds platform_copy_gap, a single bench file that runs DefaultPlatformCopy on every host (FICLONE/copy_file_range on Linux, clonefile/fcopyfile on macOS, CopyFileExW/ReFS reflink on Windows) against std::fs::copy. Each host produces a platform_copy/std_baseline ratio per cell; the ratio is the kernel-fast-path win on that host and is the unit that can be compared across hosts. Records the chosen CopyMethod per cell on stderr so the Criterion report can be cross-referenced to the actual syscall. Cells: 4 KiB/64 KiB/1 MiB (100 files), 16 MiB (10 files), 256 MiB (2 files), sized so no cell exceeds ~30 s wall-clock on a typical CI runner. Independent of the kernel-async IOCP-vs-io_uring bench (#1868) which exercises a different syscall family.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
#1386) (#4258) Adds platform_copy_gap, a single bench file that runs DefaultPlatformCopy on every host (FICLONE/copy_file_range on Linux, clonefile/fcopyfile on macOS, CopyFileExW/ReFS reflink on Windows) against std::fs::copy. Each host produces a platform_copy/std_baseline ratio per cell; the ratio is the kernel-fast-path win on that host and is the unit that can be compared across hosts. Records the chosen CopyMethod per cell on stderr so the Criterion report can be cross-referenced to the actual syscall. Cells: 4 KiB/64 KiB/1 MiB (100 files), 16 MiB (10 files), 256 MiB (2 files), sized so no cell exceeds ~30 s wall-clock on a typical CI runner. Independent of the kernel-async IOCP-vs-io_uring bench (#1868) which exercises a different syscall family.
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/platform_copy_gap.rs, a single bench that runs the unifiedDefaultPlatformCopydispatcher on each host (FICLONE/copy_file_range on Linux, clonefile/fcopyfile on macOS, CopyFileExW/ReFS reflink on Windows) againststd::fs::copyso each host produces aplatform_copy / std_baselineratio - the kernel-fast-path win on that host and the unit that can be compared across hosts.CopyMethodpicked per cell on stderr at bench start so the Criterion report can be cross-referenced against the syscall path that ran.iocp_vs_iouring_matchedbench (Ensure release flow builds distributable artifacts #1868) which exercises a different syscall family (io_uring_setup/CreateIoCompletionPort).crates/fast_io/Cargo.tomlwithharness = false. No new dev-dependencies.Test plan
cargo bench -p fast_io --bench platform_copy_gapon Linux, macOS, and Windows; compare per-hostplatform_copy / std_baselineratios per cellCloses #1386.