Repository navigation
Bench variance - #17064
Bench variance#17064
Conversation
There was a problem hiding this comment.
🟡 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
| .with_inputs(|| { | ||
| discard_pending_sigterm(); | ||
| args.clone().into_iter() | ||
| }) | ||
| .bench_values(|args| black_box(uumain(args))); |
Merging this PR will improve performance by 87.91%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
|
Contributes to #14872. |
|
Benchmarks / Run memory benchmarks for uu_cp (CodSpeed) (pull_request) failed with HTTP error 618, relates to #17048. |

No description provided.