• Matthias Betz's avatar
    replace sax with a purpose-built XML tokenizer, parsing 2.2-2.9x faster · 6e9f3032
    Matthias Betz authored
    
    
    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: default avatarClaude Opus 5.5 (1M context) <noreply@anthropic.com>
    6e9f3032