Files
brolang/benchmarks/symbols/README.md
T
2026-06-10 21:46:26 +02:00

28 lines
867 B
Markdown

# Identifier interning benchmark
Run from the repository root:
```sh
odin run benchmarks/symbols -o:speed
```
The benchmark warms the pipeline once, then measures a fresh lex/parse/check
run over a generated program with 5,000 repeated identifier-heavy statements.
Timing is informational; token layout and allocation metrics are the stable
comparison points.
Results captured on 2026-06-10 with Odin `dev-2026-02:b942f72cb`:
| Metric | Before interning | After interning |
| --- | ---: | ---: |
| Elapsed time | 15.723 ms | 9.248 ms |
| Peak memory | 14,661,846 bytes | 13,220,507 bytes |
| Allocations | 40,105 | 40,112 |
| Token count | 65,032 | 65,032 |
| Token size | 56 bytes | 48 bytes |
| Unique symbols | n/a | 5 |
| Stored symbol bytes | n/a | 21 |
| Diagnostics | 0 | 0 |
The measured run reduced token size by 14.3% and peak tracked memory by 9.8%.