du: do not deduplicate --files0-from / operand names by name#12750
Open
sylvestre wants to merge 1 commit into
Open
du: do not deduplicate --files0-from / operand names by name#12750sylvestre wants to merge 1 commit into
sylvestre wants to merge 1 commit into
Conversation
GNU du deduplicates only by inode during traversal (disabled by
--count-links); it never collapses repeated operand names. uutils du
removed duplicate names from both read_files_from() and the plain
operand list, which produced two GNU-visible divergences in
tests/du/files0-from.pl:
- 'du -l --files0-from' with a file listed twice printed it once
instead of twice (-l must disable dedup).
- repeated missing files reported a single error instead of one per
occurrence (missing files have no inode to dedup on).
Drop the name-based dedup in both places and rely on the existing
inode-based dedup in the traversal loop, matching GNU. This also fixes
the plain-operand case 'du missing missing'.
Fixes tests/du/files0-from.pl.
Merging this PR will improve performance by 9.44%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Memory | cp_recursive_deep_tree[(120, 4)] |
615.6 KB | 562.5 KB | +9.44% |
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:du-gnu (0070306) with main (82ff021)
Footnotes
-
92 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. ↩
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.
Fixes tests/du/files0-from.pl.