Skip to content

Conversation

@Clickin
Copy link
Owner

@Clickin Clickin commented Nov 14, 2025

  • Replace substring() with index-based string matching to avoid allocations
  • Add matches() and findString() methods for zero-copy comparisons
  • Pre-define XML entities as static arrays and Maps
  • Use charCodeAt() for character comparisons instead of string equality
  • Initialize XmlNode fields upfront for V8 hidden class optimization
  • Add early-exit optimization in entity decoding

These optimizations significantly improve performance when parsing large XML documents by reducing string allocations and improving cache locality.

Reference: StaxXmlParserSync optimization patterns

- Replace substring() with index-based string matching to avoid allocations
- Add matches() and findString() methods for zero-copy comparisons
- Pre-define XML entities as static arrays and Maps
- Use charCodeAt() for character comparisons instead of string equality
- Initialize XmlNode fields upfront for V8 hidden class optimization
- Add early-exit optimization in entity decoding

These optimizations significantly improve performance when parsing large
XML documents by reducing string allocations and improving cache locality.

Reference: StaxXmlParserSync optimization patterns
@Clickin Clickin merged commit b18e9e8 into main Nov 14, 2025
1 of 3 checks passed
@Clickin Clickin deleted the claude/xapi-js-c-01Y6TckQTBdQP1MafKVd8XxF branch November 14, 2025 01:24
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.

3 participants