Skip to content

Add CodSpeed continuous benchmarking#277

Open
codspeed-hq[bot] wants to merge 1 commit into
mainfrom
codspeed/wizard-1782038954998
Open

Add CodSpeed continuous benchmarking#277
codspeed-hq[bot] wants to merge 1 commit into
mainfrom
codspeed/wizard-1782038954998

Conversation

@codspeed-hq

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

Copy link
Copy Markdown

Summary

This PR sets up CodSpeed to continuously measure the performance of Sury in CI, so performance regressions are caught automatically on every pull request.

The repository already had a benchmark.js suite in packages/e2e (Benchmark.res). This integration reuses that suite directly rather than introducing a parallel one.

Changes

  • Benchmark harness: Wrapped the existing benchmark.js Suite with withCodSpeed from @codspeed/benchmark.js-plugin. The change is applied to both the ReScript source (Benchmark.res) and its committed generated output (Benchmark.res.mjs) so they stay in sync. When not running under CodSpeed, the suite behaves exactly as before.
  • Dependency: Added @codspeed/benchmark.js-plugin as a dev dependency of packages/e2e (lockfile updated).
  • CI workflow: Added .github/workflows/codspeed.yml. It installs dependencies with pnpm and runs the benchmarks through CodSpeedHQ/action@v4 in simulation mode, using OIDC authentication. It triggers on pushes to main, on pull requests, and via workflow_dispatch (to let CodSpeed generate baseline data).
  • README: Added the CodSpeed badge.

Validation

The setup was verified locally with the CodSpeed CLI:

codspeed run --mode simulation -- node ./src/benchmark/Benchmark.res.mjs

All 19 benchmarks were measured and reported successfully under CPU simulation.

Notes

  • The benchmarks run on the standard ubuntu-24.04 GitHub-hosted runner, consistent with the existing CI. Simulation mode is hardware-agnostic, so no specialized runners are required.
  • Once this is merged and CodSpeed has baseline data, performance reports will appear directly on pull requests.

Next steps

  • Merge this PR so CodSpeed can collect a performance baseline from main.
  • Review subsequent PRs for the automatic CodSpeed performance report.

@codspeed-hq

codspeed-hq Bot commented Jun 21, 2026

Copy link
Copy Markdown
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-hq codspeed-hq Bot marked this pull request as ready for review June 21, 2026 10:57

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Details
Benchmark suite Current: 3fece52 Previous: c54107f Ratio
S.schema - make 2536465 ops/sec (±0.56%) 2398575 ops/sec (±1.23%) 0.95
S.schema - make + parse 53692 ops/sec (±5.32%) 29310 ops/sec (±6.48%) 0.55
S.schema - parse 4790734 ops/sec (±0.77%) 4274227 ops/sec (±0.48%) 0.89
S.schema - parse strict 4496380 ops/sec (±0.66%) 3741471 ops/sec (±0.44%) 0.83
S.schema - make + reverse 376892 ops/sec (±1.43%) 365460 ops/sec (±0.55%) 0.97
S.schema - make + reverse convert 81054 ops/sec (±0.85%) 46515 ops/sec (±0.63%) 0.57
S.schema - reverse convert 3681953 ops/sec (±0.61%) 2878997 ops/sec (±0.35%) 0.78
S.schema - reverse convert (compiled) 128554446 ops/sec (±6.69%) 131756222 ops/sec (±3.83%) 1.02
S.schema - assert 3392020 ops/sec (±0.53%) 3111535 ops/sec (±0.71%) 0.92
S.schema - assert (compiled) 70045353 ops/sec (±2.56%) 69843432 ops/sec (±2.09%) 1.00
S.schema - assert strict 2816347 ops/sec (±0.81%) 2542963 ops/sec (±0.50%) 0.90
S.object - make 435091 ops/sec (±0.34%) 431984 ops/sec (±0.19%) 0.99
S.object - make + parse 42353 ops/sec (±1.64%) 21529 ops/sec (±1.64%) 0.51
S.object - parse 4989267 ops/sec (±0.44%) 4452364 ops/sec (±0.76%) 0.89
S.object - make + reverse 65185 ops/sec (±0.61%) 63926 ops/sec (±0.15%) 0.98
S.object - make + reverse convert 30533 ops/sec (±1.85%) 19297 ops/sec (±1.80%) 0.63
S.object - reverse convert 3421609 ops/sec (±0.59%) 2847176 ops/sec (±0.60%) 0.83
S.string - parse 6295137 ops/sec (±0.33%) 5236562 ops/sec (±0.55%) 0.83
S.string - reverse convert 5245659 ops/sec (±0.99%) 4410046 ops/sec (±0.98%) 0.84

This comment was automatically generated by workflow using github-action-benchmark.

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