Issue #2498: Benchmark: a typed JSON read through a grammar entry against serde_json

Open and answer this issue on GitHub.

ready, json · opened 2026-11-21 · updated 2026-11-22 · 0 comments

Part of #1019 After #2496

What it is

A benchmark that shows what a typed read through a grammar entry (ADR-grammar-2, now ADR-grammar-typed-read-v1) costs against serde_json. This is step 5 of #1019, placed after the string views (step 3e, #2496) in the original build order. It is counted with callgrind, never timed (docs/measuring.md).

To build

  1. Benchmark in benches/json/, modelled on benches/brc/:
    • input: a Vec of a struct with String, i64, f64, bool, a T? and a nested list;
    • against serde_json::from_slice with derive, both release builds with opt-level = 3 and the same LTO setting, the same output byte for byte;
    • counted with callgrind (instructions, mispredicted branches), never timed;
    • also a row for today’s json::parse plus a conversion by hand.

Done when

benches/json/ holds the Nikaia typed read, the serde_json derive reader and the json::parse plus conversion row, all printing the same output byte for byte, with a callgrind table (instructions, mispredicted branches) per row; that commit says Fixes #N.

Files

benches/json/ (new), modelled on benches/brc/.

Split from #1019 by Claude Code

Back to Open Issues