Skip to content

ci: add CodSpeed benchmarks for find and xargs - #703

Merged
sylvestre merged 2 commits into
mainfrom
codspeed-benchmarks
Jun 6, 2026
Merged

sylvestre merged 2 commits into
mainfrom
codspeed-benchmarks

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

Introduce continuous performance benchmarking with CodSpeed, mirroring the setup in uutils/grep.

What's included

  • benches/find_bench.rs — drives find end-to-end through find_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/-iname globs, -regex, -size, a grouped AND/OR expression, -prune, and -printf. Output goes to an io::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 — drives xargs end-to-end through xargs_main. Input is fed via -a <file> (no stdin plumbing needed) and the command is true, 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 / -s batching paths.

  • .github/workflows/codspeed.yml — runs the benchmarks on main pushes, PRs and workflow_dispatch, installing cargo-codspeed via moonrepo/setup-rust and running through CodSpeedHQ/action@v4 in simulation mode.

  • Cargo.toml — adds the codspeed-criterion-compat dev-dependency (pinned 4.7.0, matching grep) and the two [[bench]] entries with harness = false.

Notes

  • cargo fmt --all -- --check and cargo clippy --all-targets --all-features are clean.
  • For CodSpeed to collect data the repository needs to be connected to CodSpeed; id-token: write and the workflow_dispatch backtest trigger are already wired in.

sylvestre added 2 commits June 6, 2026 10:04
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

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.05%. Comparing base (c5ff1bb) to head (4a9fc1b).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Congrats! CodSpeed is installed 🎉

🆕 13 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


Open in CodSpeed

@sylvestre
sylvestre merged commit 33703b7 into main Jun 6, 2026
34 checks passed
@sylvestre
sylvestre deleted the codspeed-benchmarks branch June 6, 2026 08:37
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.

1 participant