Skip to content

ci: measure the engines with CodSpeed - #1

Merged
RAprogramm merged 1 commit into
mainfrom
codspeed/setup-benchmarks
Nov 16, 2026
Merged

RAprogramm merged 1 commit into
mainfrom
codspeed/setup-benchmarks

Conversation

@codspeed

@codspeed codspeed Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Summary

The Benchmarks (CodSpeed) job in ci.yml was already there, but the benches linked against upstream criterion, so CodSpeed had nothing it could measure. The job also needed a CODSPEED_TOKEN secret. This PR gets the integration working end to end.

Harness

  • The workspace criterion dependency now points at codspeed-criterion-compat 6.0.0, renamed to criterion. Bench code keeps its existing imports. Outside CodSpeed it still runs as plain criterion.
  • The two existing suites (wl-size/benches/compress.rs, wl-check/benches/check.rs) are kept unchanged.
  • New suites cover each engine on its own, so a regression in the full pipeline can be traced to the crate that caused it:
    • wl-html/benches/html.rs: parse (html5ever plus span alignment) and check (HTML rules) on clean, attribute-heavy and rule-violating documents
    • wl-css/benches/css.rs: the CSS scanner and rules on simple, nested (@media) and rule-violating stylesheets
    • wl-js/benches/js.rs: the oxc parse plus JS rules on small, function-heavy and rule-violating scripts
    • wl-profile/benches/profile.rs: loading and validating the embedded profile-1
  • The compat macros generate undocumented functions and trigger clippy::significant_drop_tightening. Each bench file therefore has a crate-level #![allow] with a written reason, as AGENTS.md requires. With that in place, cargo clippy --workspace --all-targets --all-features -- -D warnings -W clippy::pedantic -W clippy::nursery and cargo +nightly fmt --all --check both pass.

CI

  • The job now authenticates with OIDC (id-token: write), so the CODSPEED_TOKEN secret is no longer used.
  • CodSpeedHQ/action is bumped from v5.0.0 to v5.6.3, and actions.lock is updated to the matching commit (af75f77). The nested actions (actions/cache, actions/github-script) are the same pinned commits as before. Please regenerate the lock with gh actions-lock if you prefer.
  • The job builds all six suites in simulation mode with --locked.
  • continue-on-error is removed, so benchmark failures now show up. The job is still not part of the release gate.

README

  • Fixed the CodSpeed badge URL (https://app.codspeed.io//badge.json → https://codspeed.io/badge.json).

Local results (simulation)

All 19 benchmarks ran under codspeed run -m simulation -- cargo codspeed run. Some examples: full pipeline check/mixed (24 KiB) 7.9 ms, html_check/violations 4.8 ms, zlib9/len_32768 691 µs, profile_1_load 366 µs.

Next steps

  • Merge so main gets a baseline; after that, pull requests get performance reports.
  • Optionally turn on performance checks in the CodSpeed repository settings so regressions fail the check.
  • The CODSPEED_TOKEN secret can be deleted once this is merged.

Comment @codspeedbot add a benchmark for <function> and I'll extend the suite.

@codspeed

codspeed Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Congrats! CodSpeed is installed 🎉

🆕 19 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
codspeed Bot requested a review from RAprogramm November 16, 2026 03:34
@codspeed
codspeed Bot marked this pull request as ready for review November 16, 2026 03:34
@RAprogramm
RAprogramm merged commit 6944957 into main Nov 16, 2026
20 checks passed
@RAprogramm
RAprogramm deleted the codspeed/setup-benchmarks branch November 16, 2026 03:35
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