Skip to content

perf!: regenerate the Java parser for runtime 13 - #45

Merged
exKAZUu merged 2 commits into
mainfrom
perf/runtime-13
Oct 22, 2026
Merged

exKAZUu merged 2 commits into
mainfrom
perf/runtime-13

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Why

WillBooster/tree-sitter v13.0.0 changes the parse table layout (split terminal/goto rows, one-word parse actions, default gotos for states that training never visits) and speeds up reductions. Runtime 13 rejects parsers generated for older ABIs, so this grammar has to be regenerated with the v13.0.0 CLI to use them. Syntax trees do not change.

Wasm size (tree-sitter build --wasm --optimization z):

Wasm Bytes gzip -9
Published @willbooster/tree-sitter-java@10.0.1 (same as a rebuild of main with runtime 10.0.2) 315,827 58,282
This PR (runtime 13.0.0) 247,507 (-21.6%) 58,517 (+0.4%)

Requirements

  • required: Improve both performance and binary size of tree-sitter and our grammar repositories as much as possible.
  • required: Backward compatibility can be ignored, and the current tree structure need not be kept.
  • required: For each PR, run review-booster, then complete-pr, then release.
  • chosen: Regenerate with the repository's own script/generate (profile-guided over test/corpus) so that the tables use the same training input as before.

Customer Summary

The npm package and the Rust crate now require @willbooster/web-tree-sitter / willbooster-tree-sitter 13.0.0 or later within major version 13; older runtimes reject the parser. The Wasm module is about 22% smaller. Parse results are unchanged.

Technical Summary

  • src/parser.c and src/tree_sitter/parser.h are regenerated by script/generate with the v13.0.0 CLI (ABI 0x57420009).
  • package.json (devDependency 13.0.0, peerDependency ^13.0.0), Cargo.toml/Cargo.lock (willbooster-tree-sitter 13.0.0), bun.lock, and the runtime version, ABI number, and docs.rs link in README.md and bindings/rust/lib.rs are updated.
  • The README's Rust snippet pins willbooster-tree-sitter-java major 11, which this breaking change releases.

Testing

  • bun run verify
  • bun run test (unit, corpus, Wasm, incremental, performance, and e2e including the browser test): 78 tests passed
  • cargo test (unit test and doctest)

exKAZUu and others added 2 commits October 23, 2026 06:25
The parser now carries ABI 0x57420009 and requires @willbooster/web-tree-sitter
and willbooster-tree-sitter 13.0.0 or later within major version 13.

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
@exKAZUu exKAZUu self-assigned this Oct 22, 2026
@exKAZUu
exKAZUu merged commit 8fdddb2 into main Oct 22, 2026
10 checks passed
@exKAZUu
exKAZUu deleted the perf/runtime-13 branch October 22, 2026 22:26
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