Skip to content

bench(fast_io): platform copy fast-path gap across Linux/macOS/Windows (#1386)#4258

Merged
oferchen merged 1 commit into
masterfrom
bench/platform-copy-gap-1386
May 17, 2026
Merged

bench(fast_io): platform copy fast-path gap across Linux/macOS/Windows (#1386)#4258
oferchen merged 1 commit into
masterfrom
bench/platform-copy-gap-1386

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Adds crates/fast_io/benches/platform_copy_gap.rs, a single bench that runs the unified DefaultPlatformCopy dispatcher on each host (FICLONE/copy_file_range on Linux, clonefile/fcopyfile on macOS, CopyFileExW/ReFS reflink on Windows) against std::fs::copy so each host produces a platform_copy / std_baseline ratio - the kernel-fast-path win on that host and the unit that can be compared across hosts.
  • Records the actual CopyMethod picked per cell on stderr at bench start so the Criterion report can be cross-referenced against the syscall path that ran.
  • Cells: 4 KiB/64 KiB/1 MiB at 100 files, 16 MiB at 10 files, 256 MiB at 2 files. Sized so no cell exceeds ~30 s wall-clock on a typical CI runner; total bytes per cell stays under ~512 MiB.
  • Independent of the kernel-async iocp_vs_iouring_matched bench (Ensure release flow builds distributable artifacts #1868) which exercises a different syscall family (io_uring_setup / CreateIoCompletionPort).
  • Registers the bench in crates/fast_io/Cargo.toml with harness = false. No new dev-dependencies.

Test plan

  • CI: fmt + clippy
  • CI: nextest stable / Windows / macOS / Linux musl
  • Manual (post-merge, optional): cargo bench -p fast_io --bench platform_copy_gap on Linux, macOS, and Windows; compare per-host platform_copy / std_baseline ratios per cell

Closes #1386.

#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 oferchen merged commit e5b16d6 into master May 17, 2026
13 of 14 checks passed
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.
@oferchen oferchen deleted the bench/platform-copy-gap-1386 branch May 19, 2026 19:28
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