You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Changes
Memory
Smaller AST nodes (#55): parser.Node shrinks from 408 to 56 bytes. Fields of compound and rare node types move to lazily allocated side structs, NodeType is a uint8 enum and the processing flags are packed into a bitfield. Every compiled expression keeps its AST, so its live heap drops by about 62% across the jsonata-js suite's expressions (2,999 → 1,140 B) and about 70% on larger real-world expressions. No public API change.
API
gnata.ConsArray is exported, next to OrderedMap and JSONNull, so callers that type-switch evaluation results can name the constructed array type (closes #54).
Performance
Compile is 28–36% faster. Some evaluation benchmarks are 1–4% slower (one extra pointer load for moved fields); the geometric mean across benchmarks is 6.7% faster with 17% fewer bytes allocated.
Tests
Coverage 93.8%; the jsonata-js suite passes under Go, js/wasm and the TinyGo/WASI build.