Skip to content

Bench variance - #17064

Merged
sylvestre merged 3 commits into
uutils:mainfrom
sylvestre:bench-variance
Dec 1, 2026
Merged

sylvestre merged 3 commits into
uutils:mainfrom
sylvestre:bench-variance

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 12:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The timeout benchmarks reset signals during batched input generation, allowing subsequent invocations to consume stale SIGTERM instead of waiting for their timers.

1 open issue
What changed in this PR

This PR aims to reduce benchmark variance in timeout, df, and cp by making workloads more consistent across runs and machines.

Changes:

  • Uses a self-spawned child for timeout enforcement and adds pending-SIGTERM cleanup.
  • Replaces df’s deep-directory benchmark with table formatting over synthetic filesystem data.
  • Moves the deep-copy benchmark’s files into the leaf directory to reduce directory-order effects.
File Description
src/​uu/​timeout/​benches/​timeout_bench.rs Standardizes the child workload and adds signal cleanup.
src/​uu/​df/​Cargo.toml Removes the unused benchmark feature dependency.
src/​uu/​df/​benches/​df_bench.rs Benchmarks output styles using a fixed synthetic mount table.
src/​uu/​cp/​benches/​cp_bench.rs Places all deep-tree files in the leaf directory.

Review effort: Balanced

Comment on lines +68 to 72
.with_inputs(|| {
discard_pending_sigterm();
args.clone().into_iter()
})
.bench_values(|args| black_box(uumain(args)));
@codspeed

codspeed Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 87.91%

1 warning

⚠️ 5 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 1 improved benchmark
✅ 9 untouched benchmarks
🆕 10 new benchmarks
⏩ 480 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory timeout_enforced 167.5 KB 89.1 KB +87.91%
🆕 Memory df_write_table[--output] N/A 31 MB N/A
🆕 Memory df_write_table[--total] N/A 17.3 MB N/A
🆕 Memory df_write_table[-h] N/A 16.5 MB N/A
🆕 Memory df_write_table[-i] N/A 17.1 MB N/A
🆕 Memory df_write_table[-k] N/A 17.3 MB N/A
🆕 CPU Simulation df_write_table[--output] N/A 582.8 ms N/A
🆕 CPU Simulation df_write_table[--total] N/A 359 ms N/A
🆕 CPU Simulation df_write_table[-h] N/A 425.1 ms N/A
🆕 CPU Simulation df_write_table[-i] N/A 332.8 ms N/A
🆕 CPU Simulation df_write_table[-k] N/A 332.5 ms N/A

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing sylvestre:bench-variance (2a01833) with main (279cdbf)2

Open in CodSpeed

Footnotes

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

  2. No successful run was found on main (19e48ff) during the generation of this report, so 279cdbf was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@xtqqczze

xtqqczze commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Contributes to #14872.

@xtqqczze

xtqqczze commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Benchmarks / Run memory benchmarks for uu_cp (CodSpeed) (pull_request) failed with HTTP error 618, relates to #17048.

@sylvestre
sylvestre merged commit 48819c9 into uutils:main Dec 1, 2026
98 of 108 checks passed
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