Skip to content

v1.5.1 — 6.1x large-payload speedup + fresh benchmarks

Choose a tag to compare

@buger buger released this 29 Jul 06:02
· 8 commits to master since this release

🔒 Covered by ReqProof — L3 Assurance (123 requirements, 0 errors, 0 warnings)

Performance — 6.1x large-payload speedup

Two optimizations found via ADHD-driven profiling + 10 parallel worktree experiments:

  1. Fix stringEnd unbounded backslash scanstringEndConfig was scanning the ENTIRE remaining parent document for backslashes instead of just the string body. Bounded to data[:firstQuote]. 128µs → 22µs (5.8x).

  2. SWAR string scan — replaced two separate bytes.IndexByte calls with a single inline 8-byte SWAR loop checking for both " and \ simultaneously. 22µs → 21µs (additional 8%).

Fresh benchmarks (all libraries at latest versions)

Methodology: Apple M4 Max (ARM64), Go 1.26.3, median of 5 runs. All comparison libraries updated. The encoding/json benchmark no longer uses ffjson-generated methods (fixed #126 in v1.3.1).

Payload jsonparser encoding/json easyjson jsonparser advantage
Small (190B) 382 ns / 0 allocs 1,335 ns / 9 allocs 312 ns / 4 allocs 3.5x faster, 0 allocs
Medium (2.4kB) 3,894 ns / 0 allocs 10,564 ns / 18 allocs 2,444 ns / 7 allocs 2.7x faster, 0 allocs
Large (24kB) 20,788 ns / 0 allocs 134,123 ns / 147 allocs 32,765 ns / 134 allocs 6.4x faster, 0 allocs

jsonparser is the fastest library overall on large payloads and the only zero-allocation parser.

Full changelog: CHANGELOG.md