Skip to content

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

Open
sylvestre wants to merge 2 commits into
uutils:mainfrom
sylvestre:du-gnu
Open

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

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

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 4.88%

⚡ 1 improved benchmark
✅ 330 untouched benchmarks
⏩ 46 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation sort_ascii_utf8_locale 16.1 ms 15.4 ms +4.88%

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 (6537d0e) with main (51529dc)

Open in CodSpeed

Footnotes

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

@cakebaker

Copy link
Copy Markdown
Contributor

I don't know if you have seen it: the changes break the test_du_deduplicated_input_args test on Windows.

sylvestre added 2 commits July 4, 2026 17:39
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.
Windows CreateFile rejects opening a directory for a plain read handle,
so get_file_info()/get_blocks() always returned no inode for directories,
silently disabling inode-based dedup there. This was previously masked by
name-based operand dedup; removing that dedup exposed it, breaking
test_du_deduplicated_input_args on Windows CI.
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/flush-initial. tests/tail/flush-initial is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cut/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/tail/pid is now being skipped but was previously passing.
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

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