JSON parser performance by shape
Mean parse time in microseconds. Lower is better. BenchmarkDotNet ShortRun, .NET 10 on Arm64. Four lines, one per input shape (Big, Deep, Long, Wide). Regenerated automatically on every benchmark run. Run: 2026-10-02 12:51
- Parsers are ordered left to right by their time on the Big shape (fastest to slowest). The same parser order is used for all four lines, so a dip or spike tells you that parser is unusually fast or slow on that shape.
- Shape definitions: Big = balanced (4 root elements, depth 4, width 3). Long = 256 top-level elements. Deep = 256 levels of nesting. Wide = one object with 256 members. See README.md for full methodology.
- Superpower crashes with an uncatchable
StackOverflowException on Deep (256 levels overflow its combinator pipeline). Shown as a gap in the Deep line.
- Pegasus appears twice: PegasusOptimized uses idiomatic patterns (
[^"\\]+ bulk runs, <min,max,sep> delimited repetition); PegasusWiki is the per-character style shown in the Pegasus wiki JSON example.
- Pidgin uses the bulk-run fast path via
Token(pred).AtLeastOnceString(). Sprache and Superpower use per-character ordered choice (bulk-run measured slower on those libraries, see README).
- Deep is the odd shape out: Parlot and ParlotCompiled are both faster than STJ there. Deep has far fewer characters than the other shapes (~2,600 vs 5,000-8,000), so per-level overhead dominates and STJ's depth-validation cost tips it into last place among the fast parsers.