bench:check: run the benchmarks without dev checks #53

Merged
sionzee merged 1 commit from evobug/bench-no-dev-checks into main 2026-11-16 17:31:08 +01:00
Owner

npm run bench:check failed on PRs: "match / switch, through the transform" measured 2.27x, past its limit of 1.92x.

Cause: dev checks, not automatic library analysis. scripts/bench-check.mjs started node --import …/register.mjs packages/std/bench/match.bench.ts with the caller's environment, so the Node loader added the dev checks. With those on, match also checks every variant it gets. The baseline of 0.96x was recorded before match had that dev check, so the ratio has been sitting just under the limit since.

Measured locally (match / switch):

Branch Dev checks on Dev checks off
main 1.60x 0.97x
#52 (automatic analysis) 1.77x 0.98x
#49 (match on Option) 1.92x 1.00x

Fix: every benchmark bench-check starts now runs with SAFE_TS_DEV_CHECKS=0, like npm run bench already does (#46). That's what production runs. The README's benchmark section says so.

After the fix: npm run bench:check passes, with match / switch at 1.10x (limit 1.92x) and 29 ratios in 24 s.

🤖 Generated with Claude Code

`npm run bench:check` failed on PRs: "match / switch, through the transform" measured 2.27x, past its limit of 1.92x. **Cause:** dev checks, not automatic library analysis. `scripts/bench-check.mjs` started `node --import …/register.mjs packages/std/bench/match.bench.ts` with the caller's environment, so the Node loader added the dev checks. With those on, `match` also checks every variant it gets. The baseline of 0.96x was recorded before `match` had that dev check, so the ratio has been sitting just under the limit since. Measured locally (`match` / switch): | Branch | Dev checks on | Dev checks off | |---|---|---| | main | 1.60x | 0.97x | | #52 (automatic analysis) | 1.77x | 0.98x | | #49 (match on Option) | 1.92x | 1.00x | **Fix:** every benchmark bench-check starts now runs with `SAFE_TS_DEV_CHECKS=0`, like `npm run bench` already does (#46). That's what production runs. The README's benchmark section says so. **After the fix:** `npm run bench:check` passes, with `match` / switch at 1.10x (limit 1.92x) and 29 ratios in 24 s. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bench:check: run the benchmarks without dev checks
All checks were successful
Benchmarks / bench (pull_request) Successful in 2m6s
15c6e8225b
scripts/bench-check.mjs spawned `node --import register ...` with the caller's
environment, so the Node loader added the dev checks. `match` then also
checks every variant it gets: the "match / switch, through the transform"
ratio sat at 1.6-1.9x locally (limit 1.92x) and failed on the CI runner at
2.27x, against a baseline of 0.96x recorded before match had a dev check.
With SAFE_TS_DEV_CHECKS=0 it measures 1.10x, what production runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
sionzee deleted branch evobug/bench-no-dev-checks 2026-11-16 17:31:08 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Evobug/Safe-Ts!53
No description provided.