Skip to content

du: do not deduplicate --files0-from / operand names by name#12750

Open
sylvestre wants to merge 1 commit into
uutils:mainfrom
sylvestre:du-gnu
Open

du: do not deduplicate --files0-from / operand names by name#12750
sylvestre wants to merge 1 commit into
uutils:mainfrom
sylvestre:du-gnu

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

Fixes tests/du/files0-from.pl.

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.
@codspeed-hq

codspeed-hq Bot commented Jun 10, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 9.44%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 276 untouched benchmarks
⏩ 92 skipped benchmarks1

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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.

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