Skip to content

v0.2.1

Choose a tag to compare

@wolfeidau wolfeidau released this 22 Oct 17:14
9d84c78

v0.2.1

Performance release. No API or behaviour changes.

Changes

  • Scanner and Stripper skip plain text. Outside an escape sequence they jump to the next ESC with bytes.IndexByte instead of stepping byte by byte.
  • Parse allocates less. It no longer builds a map or splits the body, and converts values to strings only for known keys.
  • ValidID no longer allocates.
  • Adds benchmarks and a make bench target.

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