Skip to content

Add CodSpeed performance benchmarks#297

Merged
sylvestre merged 2 commits into
mainfrom
codspeed/wizard-1780601706208
Jun 4, 2026
Merged

Add CodSpeed performance benchmarks#297
sylvestre merged 2 commits into
mainfrom
codspeed/wizard-1780601706208

Conversation

@codspeed-hq
Copy link
Copy Markdown
Contributor

@codspeed-hq codspeed-hq Bot commented Jun 4, 2026

This PR sets up continuous performance tracking for the uutils tar project using CodSpeed.

What's included

Benchmark suite (benches/bench_tar.rs)

Seven benchmarks covering the core tar operations, using divan with the CodSpeed compatibility layer:

  • Archive creation: create_archive_10_files, create_archive_100_files, create_archive_directory -- measures file-level and directory-level archive creation at different scales.
  • Archive listing: list_archive_50_files, list_archive_verbose_50_files -- measures entry enumeration in simple and verbose mode.
  • Archive extraction: extract_archive_20_files -- measures full extraction to disk.
  • CLI parsing: build_cli_command -- measures the cost of constructing the clap command definition.

Each benchmark creates temporary sample files as setup and exercises the real uu_tar operation functions directly.

CI workflow (.github/workflows/codspeed.yml)

A GitHub Actions workflow that runs benchmarks on every push to main and on pull requests, using CodSpeed's simulation mode (CPU instruction counting). This provides deterministic, low-variance measurements regardless of CI runner load.

The workflow also supports workflow_dispatch to allow CodSpeed to trigger backtesting for initial baseline data.

Other changes

  • src/uu/tar/src/tar.rs: The operations module is now pub so the benchmark suite can call create_archive, list_archive, and extract_archive directly.
  • Cargo.toml: Added codspeed-divan-compat as a dev-dependency and the [[bench]] target.
  • README.md: Added CodSpeed badge.

Next steps

Once this PR is merged and the benchmarks run on main, CodSpeed will automatically:

  • Report performance changes on future pull requests.
  • Generate flamegraphs for each benchmark to help diagnose regressions.
  • Track historical performance trends on the CodSpeed dashboard.

@codspeed-hq
Copy link
Copy Markdown
Contributor Author

codspeed-hq Bot commented Jun 4, 2026

Congrats! CodSpeed is installed 🎉

🆕 7 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

@codspeed-hq codspeed-hq Bot marked this pull request as ready for review June 4, 2026 19:47
@codspeed-hq codspeed-hq Bot requested a review from kaladron as a code owner June 4, 2026 19:47
@codspeed-hq codspeed-hq Bot force-pushed the codspeed/wizard-1780601706208 branch from 57641f4 to c9f88f0 Compare June 4, 2026 19:50
@sylvestre sylvestre merged commit 14185c5 into main Jun 4, 2026
26 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.

1 participant