Skip to content

Add CodSpeed performance benchmarks#13

Merged
sylvestre merged 1 commit into
mainfrom
codspeed-wizard-1780213675759
May 31, 2026
Merged

Add CodSpeed performance benchmarks#13
sylvestre merged 1 commit into
mainfrom
codspeed-wizard-1780213675759

Conversation

@codspeed-hq
Copy link
Copy Markdown

@codspeed-hq codspeed-hq Bot commented May 31, 2026

Summary

This PR sets up continuous performance testing with CodSpeed for the uutils/grep project, providing automated detection of performance regressions on every pull request.

Changes

Benchmark suite (benches/grep_bench.rs)

15 benchmarks covering the core performance-critical paths:

Pattern compilation (5 benchmarks) -- measures regex compilation cost across all supported modes:

  • Fixed string, basic regex, extended regex, Perl regex, and multi-pattern compilation

Line matching (8 benchmarks) -- exercises the main matching hot path with different configurations:

  • Fixed string match (hit and miss), extended regex match, case-insensitive match, inverted match, word boundary match, multi-pattern match, and long line matching

Throughput scanning (2 benchmarks) -- simulates realistic log file searching over 1000 lines:

  • Fixed string scanning and regex scanning

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 CPU simulation instrument for deterministic, low-variance measurements.

Visibility changes (src/lib.rs)

Internal types (Config, Matcher, RegexMode, etc.) are marked pub with #[doc(hidden)] so they can be accessed from the benchmark harness without polluting the public API documentation. A GlobSet::new() constructor was added for the same purpose.

README badge

Added a CodSpeed performance badge alongside the existing badges.

Next steps

  • After merging, CodSpeed will automatically start tracking performance on subsequent PRs and pushes to main.
  • Performance results and flamegraphs will be available in the CodSpeed dashboard.
  • Additional benchmarks can be added to benches/grep_bench.rs as needed (e.g., file I/O throughput, recursive directory scanning).

@codspeed-hq
Copy link
Copy Markdown
Author

codspeed-hq Bot commented May 31, 2026

Congrats! CodSpeed is installed 🎉

🆕 15 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 May 31, 2026 08:02
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.48%. Comparing base (2a6a3ab) to head (079619e).

Files with missing lines Patch % Lines
src/lib.rs 16.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
- Coverage   95.82%   95.48%   -0.34%     
==========================================
  Files           6        6              
  Lines        1414     1419       +5     
  Branches      140      140              
==========================================
  Hits         1355     1355              
- Misses         58       63       +5     
  Partials        1        1              
Flag Coverage Δ
macOS_latest 96.30% <16.66%> (-0.35%) ⬇️
ubuntu_latest 96.30% <16.66%> (-0.35%) ⬇️
windows_latest 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@sylvestre sylvestre merged commit ddac723 into main May 31, 2026
13 of 18 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