Skip to content

benchmarks: prepare args outside benchmark#10388

Draft
xtqqczze wants to merge 1 commit intouutils:mainfrom
xtqqczze:get_benchmark_args
Draft

benchmarks: prepare args outside benchmark#10388
xtqqczze wants to merge 1 commit intouutils:mainfrom
xtqqczze:get_benchmark_args

Conversation

@xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Jan 20, 2026

Currently, we construct uucore::Args within the measured section of benchmarks. That adds allocation and conversion overhead and will skew the results.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 20, 2026

Merging this PR will degrade performance by 14.62%

⚡ 8 improved benchmarks
❌ 6 regressed benchmarks
✅ 285 untouched benchmarks
⏩ 47 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation sort_numeric[500000] 1 s 1 s +3.26%
Memory du_deep_tree[(100, 3)] 3,209.6 KB 104.5 KB ×31
Simulation fold_many_lines[100000] 61.8 ms 63.8 ms -3.19%
Simulation fold_custom_width[50000] 24.3 ms 25.3 ms -4.03%
Simulation unexpand_large_file[10] 281.5 ms 270.8 ms +3.97%
Simulation unexpand_many_lines[100000] 134.4 ms 129.2 ms +3.96%
Simulation seq_integers 26.6 ms 24.9 ms +6.81%
Simulation seq_with_step 13.5 ms 12.7 ms +6.82%
Simulation seq_custom_separator 29.3 ms 27.6 ms +6.15%
Simulation expand_custom_tabstops[50000] 16.6 ms 17.8 ms -7.16%
Simulation expand_many_lines[100000] 64.6 ms 69.2 ms -6.58%
Simulation cp_large_file[16] 278 µs 261 µs +6.52%
Simulation true_consecutive_calls 170.3 ns 199.4 ns -14.62%
Simulation false_consecutive_calls 170.3 ns 199.4 ns -14.62%

Comparing xtqqczze:get_benchmark_args (2ba6b6a) with main (9654e4a)

Open in CodSpeed

Footnotes

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

@xtqqczze
Copy link
Contributor Author

@sylvestre Please could you confirm whether these changes are viable to apply in full?

@sylvestre
Copy link
Contributor

i guess ? :)

@xtqqczze
Copy link
Contributor Author

Need to refactor to handle the following case:

bencher.bench(|| {
fs_utils::remove_path(&dest);
let mut full_args = Vec::with_capacity(args.len() + 2);
full_args.extend_from_slice(args);
full_args.push(source_str);
full_args.push(dest_str);

@oech3
Copy link
Contributor

oech3 commented Jan 26, 2026

Should we wait working about #10486 until your PR was merged?
Any chance for splitting PR?

xtqqczze added a commit to xtqqczze/uutils-coreutils that referenced this pull request Jan 26, 2026
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/pr/bounded-memory. tests/pr/bounded-memory is passing on 'main'. Maybe you have to rebase?

@oech3
Copy link
Contributor

oech3 commented Feb 13, 2026

is this able to merge?

@xtqqczze
Copy link
Contributor Author

is this able to merge?

I couldn't work out how to handle all the cases, such as #10388 (comment)

@oech3
Copy link
Contributor

oech3 commented Feb 15, 2026

How about splitting this PR?

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tty/tty-eof (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.
Congrats! The gnu test tests/cp/link-heap is now passing!
Congrats! The gnu test tests/cut/cut-huge-range is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@xtqqczze

This comment was marked as outdated.

@oech3
Copy link
Contributor

oech3 commented Mar 5, 2026

Any progress about this?

@xtqqczze xtqqczze force-pushed the get_benchmark_args branch from b2aedf9 to ae7ca7b Compare March 5, 2026 21:23
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)

@xtqqczze xtqqczze force-pushed the get_benchmark_args branch from ae7ca7b to 8b71b7f Compare March 5, 2026 22:06
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)

@xtqqczze xtqqczze force-pushed the get_benchmark_args branch from 8b71b7f to 2ba6b6a Compare March 5, 2026 23:25
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/csplit/csplit-heap is now being skipped but was previously passing.

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.

3 participants