mv: add --exchange to atomically swap two paths - #13215
Conversation
|
GNU testsuite comparison: |
Merging this PR will improve performance by 8.14%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | mv_multiple_to_dir |
28 ms | 24.7 ms | +13.41% |
| ⚡ | Simulation | numfmt_to_si_precision[10000] |
93.3 ms | 90.5 ms | +3.12% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing sylvestre:mv-exchange (486621f) with main (0950712)
Footnotes
-
46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
7c63a6d to
a3dc47b
Compare
|
@codspeedbot fix this regression |
I profiled the two regressed benchmarks and pushed a fix that recovers most of the loss. Root cause: it is CLI parsing, not What I changed (commit
Measured locally with
Remaining delta: ~2.5% on the two single-file benchmarks. That is the intrinsic cost of one extra Validation: Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
|
Hello @sylvestre, once again the agent opened another PR (#13633) because we don't support fork PRs at this time. I'm actively working on this. We're not blocking the agent so it can still do the work you request, even if it means you'll have to manually cherry-pick and manage multiple PRs. |
|
@SuperMuel pas de soucis, merci! |
Should make test tests/mv/mv-exchange.sh pass
The same-file detection and the two-path handling in mv issued several stat calls whose result was already available, and assert_not_same_file formatted the quoted target path used in error messages even when the move succeeded. Reuse a single symlink_metadata lookup per path, only build the error string when an error is reported, and make the hardlink comparison helpers in uucore look up the target first so they can return early when it does not exist.
Should make test tests/mv/mv-exchange.sh pass