Skip to content

Add scenario benchmarks and fix ops/sec benchmarks on v1 - #1830

Merged
markwpearce merged 3 commits into
v1from
additional-benchmarks
Sep 24, 2026
Merged

markwpearce merged 3 commits into
v1from
additional-benchmarks

Conversation

@markwpearce

Copy link
Copy Markdown
Collaborator

Adds npm run benchmark:scenarios - runs real projects (pinned to a commit) and records cold load/validate, validate phases, retained heap, peak RSS, and edit re-validation (typing in a shared file vs a leaf file). Also hashes the diagnostics so a perf change that changes behavior gets caught. Can compare bsc versions or results from different branches, and capture/summarize cpu and heap profiles. This is what I used for #1827, #1828 and #1829.

Also fixes the existing ops/sec benchmarks, which were mostly broken on v1:

  • transpile/transpile-brs used file.transpile(), which BrsFile doesn't have in v1
  • diagnosticFilters: ['**/*'] is a code in v1, not a glob, so it filtered nothing
  • v8-profiler-next doesn't build on node 22 - switched to the built-in inspector
  • --noprepare and --quick didn't work

🤖 Generated with Claude Code

markwpearce and others added 2 commits September 24, 2026 10:21
`npm run benchmark:scenarios` runs pinned real projects in a fresh process each and records cold load/validate time, validate phases, retained heap, peak RSS, edit re-validation (shared vs leaf file, comment vs new function) and a diagnostics hash so behavior changes get caught. Can compare bsc versions, compare results across branches, capture cpu/heap/edit profiles and summarize them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- transpile/transpile-brs used `file.transpile()`, which BrsFile doesn't have in v1 (transpile-brs threw, transpile silently only did xml). Uses `program.getTranspiledFileContents()` when available
- `diagnosticFilters: ['**/*']` is a diagnostic code in v1, not a glob, so it filtered nothing. Silence printing instead
- replace v8-profiler-next (native, doesn't build on node 22) with the built-in inspector. Profiles go to .tmp/profiles
- `--noprepare` never worked, the startup `npm install` pruned the installed versions
- `--quick` didn't do anything
- remove stale results.json and dead profile code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markwpearce markwpearce added this to the v1.0.0 milestone Sep 24, 2026
@markwpearce markwpearce added the performance preformance-related issues label Sep 24, 2026
- clone to a temp dir and move it into place after checkout, so an interrupted checkout doesn't leave a dir at the wrong commit
- resolve `--bsc latest` (and ranges) to a real version before picking the install dir

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markwpearce
markwpearce merged commit 11e6dfe into v1 Sep 24, 2026
11 checks passed
@markwpearce
markwpearce deleted the additional-benchmarks branch September 24, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance preformance-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants