Skip to content

Benchmarks ​

Measured on AMD EPYC 7763 64-Core Processor, Node 24.21.0, when this site was built (2026-10-17). The fixtures are in fixtures/index.mjs. Run pnpm compare to measure on your machine.

Size ​

PayloadJSONTOONFlat Notationvs JSONJSON gzipFlat gzip
users (100 rows)16,691 B18,589 B9,151 B−45%1,496 B1,401 B
users (1000 rows)169,545 B188,544 B93,606 B−45%12,890 B12,568 B
profile (single object)146 B133 B151 B+3%135 B128 B
events (mixed shapes)3,606 B3,785 B3,179 B−12%383 B367 B
contacts (optional keys, 1000)101,947 B110,753 B59,707 B−41%11,288 B10,701 B
activity feed (500 events)162,440 B184,935 B169,092 B+4%12,447 B12,101 B

Speed ​

The median of 7 runs of 50 iterations each.

PayloadJSON.parseTOON decodeFlatType decodeFlatType encode
users (100 rows)0.096 ms1.864 ms0.324 ms0.316 ms
users (1000 rows)1.102 ms38.454 ms1.933 ms1.949 ms
profile (single object)0.001 ms0.013 ms0.006 ms0.005 ms
events (mixed shapes)0.026 ms0.370 ms0.166 ms0.162 ms
contacts (optional keys, 1000)0.606 ms7.949 ms1.464 ms1.990 ms
activity feed (500 events)0.760 ms13.249 ms4.008 ms2.783 ms

What these numbers mean ​

  • The savings come from lists of objects. Keys are written once per table instead of once per row, and nested fields go into the header. A single small object is about the size of its JSON.
  • Lists whose objects have different keys (the contacts, the activity feed and the mixed events) use Flat Notation 1.1: tables with optional fields such as phone?, and [+] items for what can't be a table. Before v1.14 they were written with an index on every line, larger than JSON and twice its size after gzip.
  • Gzip removes most of JSON's repetition, so over a compressed connection the difference is small. The big wins are where text isn't compressed: LLM prompts and tool results (billed per token), logs, caches and local storage.
  • JSON.parse is native code and stays faster. FlatType's decoder is plain TypeScript and runs in time linear in the input size, which the hardening tests check on every push.
  • TOON is the Token-Oriented Object Notation reference implementation, measured with the same fixtures. It doesn't flatten nested objects into table headers, so on the list payloads here it comes out larger than JSON.

Released under the MIT License.