Changes
Memory
- Smaller AST nodes (#55):
parser.Nodeshrinks from 408 to 56 bytes. Fields of compound and rare node types move to lazily allocated side structs,NodeTypeis auint8enum 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.ConsArrayis exported, next toOrderedMapandJSONNull, so callers that type-switch evaluation results can name the constructed array type (closes #54).
Performance
Compileis 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.