Repository navigation
ci: add CodSpeed benchmarks for find and xargs - #703
Merged
Merged
Conversation
Introduce criterion benchmarks (via codspeed-criterion-compat) that drive find and xargs end-to-end through their real entry points, plus a CodSpeed GitHub Actions workflow to track performance on pushes and PRs. - benches/find_bench.rs: walks a generated directory tree exercising the matcher tree (-name/-iname/-regex/-size/-type, grouping, -prune, -printf). Output is sent to a sink so the directory walk and matching dominate. - benches/xargs_bench.rs: feeds a corpus via -a and runs 'true' so xargs' own argument reading/splitting/batching dominates (whitespace, NUL, -n, -s). - .github/workflows/codspeed.yml: mirrors the uutils/grep setup.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #703 +/- ##
=======================================
Coverage 92.05% 92.05%
=======================================
Files 35 35
Lines 7090 7090
Branches 367 367
=======================================
Hits 6527 6527
Misses 420 420
Partials 143 143 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce continuous performance benchmarking with CodSpeed, mirroring the setup in uutils/grep.
What's included
benches/find_bench.rs— drivesfindend-to-end throughfind_main, so each benchmark exercises argument parsing, the matcher tree and the directory walk together. It builds a temp directory tree (~a few thousand entries with varied names/extensions/sizes) and covers common invocations: full walk,-type f,-name/-inameglobs,-regex,-size, a grouped AND/OR expression,-prune, and-printf. Output goes to anio::sink()and the clock is fixed so the walk + matching dominate (not terminal I/O) and time-based matchers stay deterministic.benches/xargs_bench.rs— drivesxargsend-to-end throughxargs_main. Input is fed via-a <file>(no stdin plumbing needed) and the command istrue, so the measurement is dominated by xargs's own argument reading / splitting / batching rather than the child. Covers whitespace splitting, NUL-delimited (-0), and the-n/-sbatching paths..github/workflows/codspeed.yml— runs the benchmarks onmainpushes, PRs andworkflow_dispatch, installingcargo-codspeedviamoonrepo/setup-rustand running throughCodSpeedHQ/action@v4in simulation mode.Cargo.toml— adds thecodspeed-criterion-compatdev-dependency (pinned4.7.0, matching grep) and the two[[bench]]entries withharness = false.Notes
cargo fmt --all -- --checkandcargo clippy --all-targets --all-featuresare clean.id-token: writeand theworkflow_dispatchbacktest trigger are already wired in.