compact compiler ids and spans to reduce memory usage

This commit is contained in:
2026-06-12 16:55:16 +02:00
parent 99ba907f59
commit 4112b79c6b
16 changed files with 972 additions and 573 deletions
+6
View File
@@ -29,3 +29,9 @@ The measured run reduced token size by 14.3% and peak tracked memory by 9.8%.
After the iterative compiler-hardening work on 2026-06-12, the same benchmark
reported 13,222,443 peak bytes and 40,117 allocations. The reusable traversal
stacks keep allocation count effectively unchanged from the interning baseline.
After migrating persistent compiler references and spans to compact IDs on
2026-06-12, the benchmark reported 8,651,659 peak bytes and 40,117 allocations.
`Span` is 12 bytes and `Token` is 24 bytes; AST expressions, HIR expressions,
and IR instructions are 64, 88, and 88 bytes respectively. These sizes are
also printed by the benchmark to catch layout regressions.