Skip to content

bench: update @tuananh/sax-parser to 1.4 and police arity probing#17

Merged
evoactivity merged 1 commit into
mainfrom
bench/update-tuananh-1.4
Jul 19, 2026
Merged

bench: update @tuananh/sax-parser to 1.4 and police arity probing#17
evoactivity merged 1 commit into
mainfrom
bench/update-tuananh-1.4

Conversation

@evoactivity

Copy link
Copy Markdown
Owner

Updates @tuananh/sax-parser 1.2 → 1.4 and re-runs the SAX benchmarks.

The arity fast path

1.4's headline numbers came partly from a Function.length probe: zero-arity listeners skip event-argument materialization entirely. Measured directly on XMLTV: 22,865 ops/s with () => {} vs 7,250 ops/s with (_a, _b) => {}3.15x inflation. Every JS parser in the suite materializes arguments unconditionally, so the benchmark's no-op callbacks now declare parameters (same equal-work policy we applied to easysax's lazy getAttr()).

Results with equal work

  • 1.4 is a genuine 1.6-2.8x improvement over 1.2 (e.g. tokenize XMLTV 4.5k → 7.2k, RSS 14.9k → 27.2k) — it climbs past sax into the htmlparser2/saxes tier
  • eksml still leads it 3.4-4.2x on tokenize and 2.7-3.5x on stream across all fixtures
  • Reuse + event-shape sanity checks pass on 1.4 (prebuild loads, same events, reusable instances)

Both SAX tables regenerated (including the attr-heavy fixture column), claims refreshed, and the native-addon note updated to document the arity policy. 838 tests pass.

1.4 skips materializing event arguments for zero-arity listeners, which
inflated its no-op benchmark numbers ~3x. The no-op callbacks now
declare parameters so every parser materializes arguments, the work all
JS parsers do unconditionally. With equal work, 1.4 is a genuine
1.6-2.8x improvement over 1.2 but stays behind eksml on every fixture.
Tables, claims, and the native-addon note regenerated.
@evoactivity
evoactivity merged commit 24670d1 into main Jul 19, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant