Repository navigation
v0.2.1
v0.2.1
Performance release. No API or behaviour changes.
Changes
ScannerandStripperskip plain text. Outside an escape sequence they jump to the nextESCwithbytes.IndexByteinstead of stepping byte by byte.Parseallocates less. It no longer builds a map or splits the body, and converts values to strings only for known keys.ValidIDno longer allocates.- Adds benchmarks and a
make benchtarget.
Benchmarks
benchstat, n=10, Apple M4, v0.2.0 → v0.2.1:
| Benchmark | sec/op | allocs/op |
|---|---|---|
| Parse/minimal | 75.1ns → 25.4ns (−66%) | 3 → 1 |
| Parse/full | 994ns → 861ns (−13%) | 19 → 7 |
| Scanner/reports | 162.3µs → 25.5µs (−84%) | 896 → 256 |
| Stripper/reports | 250.3µs → 29.6µs (−88%) | 33 → 33 |
The "reports" streams are 128 KB of terminal output with 64 reports. Output with frequent SGR colour codes sees smaller gains than plain text.
Full changes: #6