Skip to content

mv: use copy_stream for fast cross-device move#13046

Merged
cakebaker merged 1 commit into
uutils:mainfrom
oech3:mv-cpst
Jun 23, 2026
Merged

mv: use copy_stream for fast cross-device move#13046
cakebaker merged 1 commit into
uutils:mainfrom
oech3:mv-cpst

Conversation

@oech3

@oech3 oech3 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

copy_stream has splice path and normal io::copy has some unnecessary syscall failures e.g. copy_file_range which fails at most cases with cross-device.

> hyperfine --ignore-failure "target/release/mv-main /lib/chromium/chromium /tmp/c" "target/release/mv-s /lib/chromium/chromium /tmp/c"
Benchmark 1: target/release/mv-main /lib/chromium/chromium /tmp/c
  Time (mean ± σ):      53.4 ms ±   1.4 ms    [User: 0.4 ms, System: 52.7 ms]
  Range (min … max):    51.4 ms …  60.9 ms    57 runs
Benchmark 2: target/release/mv-s /lib/chromium/chromium /tmp/c
  Time (mean ± σ):      45.7 ms ±   0.7 ms    [User: 0.5 ms, System: 45.0 ms]
  Range (min … max):    44.9 ms …  50.6 ms    58 runs
Summary
  target/release/mv-s /lib/chromium/chromium /tmp/c ran
    1.17 ± 0.04 times faster than target/release/mv-main /lib/chromium/chromium /tmp/c

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/pipe-f2. tests/tail/pipe-f2 is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@cakebaker cakebaker merged commit a27f806 into uutils:main Jun 23, 2026
174 of 176 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks!

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.

2 participants