docs(design): evaluate Chain-of-Responsibility for zero-copy path selection (#2133)#4198
Merged
Merged
Conversation
…2133) Inventories the eight zero-copy file-to-file primitives in fast_io with file:line citations and maps the existing cfg-cascade dispatch in platform_copy/dispatch.rs. Evaluates a ZeroCopyHandler trait variant against the current Strategy-trait + cfg-cascade and recommends keeping the cascade with two small fixes (cleanup helper extraction, AtomicUsize last-winner cache) rather than introducing the chain pattern.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…2133) (#4198) Inventories the eight zero-copy file-to-file primitives in fast_io with file:line citations and maps the existing cfg-cascade dispatch in platform_copy/dispatch.rs. Evaluates a ZeroCopyHandler trait variant against the current Strategy-trait + cfg-cascade and recommends keeping the cascade with two small fixes (cleanup helper extraction, AtomicUsize last-winner cache) rather than introducing the chain pattern.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…2133) (#4198) Inventories the eight zero-copy file-to-file primitives in fast_io with file:line citations and maps the existing cfg-cascade dispatch in platform_copy/dispatch.rs. Evaluates a ZeroCopyHandler trait variant against the current Strategy-trait + cfg-cascade and recommends keeping the cascade with two small fixes (cleanup helper extraction, AtomicUsize last-winner cache) rather than introducing the chain pattern.
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
fast_io(FICLONE, copy_file_range, io_uring batched copy, clonefile, fcopyfile, CopyFileExW, FSCTL_DUPLICATE_EXTENTS_TO_FILE, std::fs::copy) with file:line citations intocrates/fast_io/src/platform_copy/dispatch.rs.ZeroCopyHandlertrait + per-platform static chain variant and weighs pros (testability, telemetry hook, dedupe of cleanup) against cons (the dispatch is already 100 LoC, cfg-guards do not vanish,PlatformCopyis already a Strategy, the size-tier chain incopy_file_range.rsdoes not share its shape).Test plan
file:linecitations verified againstcrates/fast_io/src/platform_copy/dispatch.rs,types.rs,mod.rs,tests.rs, andcrates/fast_io/src/copy_file_range.rs.