Skip to content
DevTinyTools

How we measure

Measurements on this site come from running the inputs through this project's Node build (V8) and its bundled zlib, not from a vendor's documentation. This page is the audit trail: which versions produced the numbers, what the inputs were, and how to get the same output on your own machine.

Why this page exists

A number quoted without a method is a claim you have to take on trust. Parser messages change between releases, compression size depends on the document, and a serializer's default output is not a property of the data format. So every table on this site is generated from a real run, with the input and engine version kept beside the result.

The source is public under the MIT licence. If a row here is wrong, the fix is a pull request against the measurement script, not a comment on a page.

Engines used

Parser and compressor versions used for measurements
EngineVersionUsed for
Node / V8Node 22.22.2 (V8)Browser parser messages, round trips, escapes
Python / CPythonPython 3.13.12 (json)JSONDecodeError messages and bytes handling
MySQLMySQL 8.4.3 (CAST … AS JSON)CAST … AS JSON rejection messages
RubyRuby 2.6.10 (json 2.1.0)Escape-sequence comparison

The Python comparison was run under 3.9.6, 3.10.8, 3.12.14, 3.13.12. The only row that moved across those releases was the trailing-comma message, which is why the JSONDecodeError guide calls it out explicitly.

Reproduce the parser tables

The browser messages are the literal error.message values from JSON.parse. The Python table comes from a script in the repository; run it with the interpreter you want to check:

git clone https://github.com/xushoulin/DevTinyTools
cd DevTinyTools
python3 scripts/measure-python-json.py

The script prints each malformed document next to the exact JSONDecodeError it produced, including msg, lineno, colno and pos. A second block covers bytes versus text: a UTF-8 BOM, a UTF-16 payload and a Latin-1 byte each take a different path through the decoder.

Reproduce the size table

The compression figures use one document: 400 orders with a consistent object shape, indented with two spaces. It is deliberately repetitive, which makes it a best case for a compressor and a worst case for minification. The raw file is 221,421 bytes.

gzip -9 -c document.json | wc -c
brotli -c document.json | wc -c
node -e 'const d=require("./document.json");process.stdout.write(JSON.stringify(d))' > min.json
gzip -9 -c min.json | wc -c
brotli -c min.json | wc -c
Measured size of the sample document in six forms
FormSizeResult
Indented, 2 spaces221,421 B216.2 KB — the baseline
Minified124,588 B43.7% smaller than the indented file
Indented, gzip -910,879 B10.6 KB
Minified, gzip -99,700 Bonly 10.8% smaller than gzipping the indented file
Indented, brotli5,038 B4.9 KB
Minified, brotli4,791 Bonly 4.9% smaller than brotli-compressing the indented file

Those numbers are not a promise about your payload. A document full of unique IDs compresses worse, so minification keeps more of its advantage. The minify vs gzip guide explains the mechanism.

What these measurements do not prove

  • A message is not a diagnosis. Parser text describes where the engine stopped. The same message can come from an empty body, an HTML page or a missing brace; the first character is often more useful than the sentence.
  • One document is one data point. The compression table is a measured example, not a benchmark across file types. The commands above let you repeat it with your own data.
  • Versions matter. An error string that is exact on Node Node 22.22.2 (V8) may differ on the browser in your hand. Treat positions as pointers, not contracts.
  • Local processing has a limit. Tools here use the browser's numeric type, so integers above 2^53 change on a parse/stringify round trip. The precision guide shows the exact boundary.

Read the source

The measurement tables, the guides and the tools all ship from the same repository: https://github.com/xushoulin/DevTinyTools. DevTinyTools publishes the scripts so a claim can be checked rather than trusted.