Skip to content

docs(decisions): turn down the I-JSON string scan change, keep its tests - #361

Open
simonvanlierde wants to merge 1 commit into
mainfrom
adr-turn-down-i-json-scan
Open

simonvanlierde wants to merge 1 commit into
mainfrom
adr-turn-down-i-json-scan

Conversation

@simonvanlierde

Copy link
Copy Markdown
Owner

This replaces #350. Its I-JSON string scan was faster on CJK, strings.json and twitter, but 4 KB strings with one early accent got 16 to 26% slower. All four ways I tried to fix that made plain JSON or JSON5 slower beyond noise, so ADR 0004 rules it out.

  • ADR 0004 lists the change and the four variants under "Turned down", plus the exponent pre-check entry from the same branch.
  • tests/cases.rs keeps perf(parser): skip non-ASCII bytes below 0xEF in I-JSON strings #350's noncharacter-at-every-position and number overflow tests. They pass on the current scanner.
  • scripts/bench.py and just compare gain strings-accent.json, the case that showed the slowdown.
case (I-JSON) main #350 per-setting parser
strings-accent.json 18.3 ms 23.1 ms within noise
cjk.json 119 ms 67 ms -37%
rows.json (JSON) 176 ms within noise +6%

Tested: cargo nextest run -p jsonvet -p jsonvet-cli (664 passed), ruff and just --fmt --check on the bench files. Timings: hyperfine -N on an idle 32-core node, core 2, 30 runs, main first and main last, medians against 2σ.
Not checked: nothing.

The I-JSON scan from #350 was faster on CJK, strings.json and twitter,
but 4 KB strings with one early accent got 16 to 26% slower, and every
way to fix that made plain JSON or JSON5 slower beyond noise.

- ADR 0004 records the change and the four variants under "Turned
  down", with the exponent pre-check entry from the same branch.
- tests/cases.rs keeps the noncharacter-at-every-position and number
  overflow cases; they pass on the current scanner.
- scripts/bench.py and `just compare` gain strings-accent.json, the
  case that showed the slowdown.

Signed-off-by: Simon van Lierde <90462640+simonvanlierde@users.noreply.github.com>
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Playground screenshots for 5c56d7e, desktop and phone in light and dark: download the zip (kept 14 days).

This branch was successfully deployed

1 active deployment
preview — 5c56d7ec Deployed Dec 2, 2026 by simonvanlierde via preview #446
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant