replace sax with a purpose-built XML tokenizer, parsing 2.2-2.9x faster
The parser only needs element names and coordinate text. The new tokenizer
finds markup with native indexOf instead of sax's per-character state
machine and slices text only while a LinearRing is read.
- 274 MB LoD2 file: 20.1 s -> 6.9 s in Node, 23.3 s -> 8.3 s in the browser
- identical output (hash over all vertex positions and colours) on 156
test files incl. CityGML 3.0
- element names are matched case-sensitively as local names
- unterminated markup over 64 KB still fails; a truncated file still shows
what was read
- vendor/sax.js removed
Co-Authored-By:
Claude Opus 5.5 (1M context) <noreply@anthropic.com>
public/vendor/sax.js
deleted
100644 → 0
This diff is collapsed.
tests/xmlTokenizer.test.js
0 → 100644
Please register or sign in to comment