jalapenojson

Benchmark

JSON against jalapenojson: the same rows, read and written by each, in JavaScript, Python and C. Every table has the same shape: JSON in one column, jalapenojson in the next, and how many times faster or slower jalapenojson is. The reads are timed with the parse, which is what reading a document once costs, and in JavaScript, Python and C again on a document parsed once, before the clock starts, which is what each read costs a process that keeps the document. In JavaScript and Python that is done both ways jalapenojson can keep one: as the table view() opens, and as the rows decode() makes. WebAssembly was not measured for this version; its section says why.

Measured on 2026-10-13 at commit 478ac17: Intel Xeon Processor @ 2.80GHz, 4 cores, Linux 6.18.44-fc-v114; Node 22.22.0, Python 3.13.16, cc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0 with -O2, cJSON 1.7.19, yyjson 0.13.0. Reproduce with bench/run.sh.

The data

Two sets of rows with the same seven columns: id (i), user, city and plan (s), seats (i), price (f) and joined (d). They are never averaged, because they disagree about size.

  • repetitive is the shape API output usually has: a user drawn from two thousand, a city from eight (one of them Tromsø, so the text is not pure ASCII), a plan from four, a price from a price list.
  • high-entropy fills the same columns with random letters and numbers, so there is little for a compressor to find in either format.
  • nested orders, orders carrying one to six line items each, is measured for size only.

bench/data.mjs writes each set once, as JSON and as jalapenojson, and every language reads those same files.

jalapenojson stores the values column by column, every column at a fixed size: id and seats as binary integers as narrow as their values allow, price as an 8-byte double, joined as a 4-byte count of days since 1970-01-01, and each text column as wide as its longest value, with a NUL after a shorter one. At 50,000 rows the schema lines are:

repetitive    #id:i:4 #user:s:9 #city:s:12 #plan:s:10 #seats:i:1 #price:f:8 #joined:d:4
high-entropy  #id:i:4 #user:s:16 #city:s:14 #plan:s:10 #seats:i:4 #price:f:8 #joined:d:4

Size

Raw, then compressed the way a server would send it: gzip at level 6, brotli at quality 5 (compressed as it is sent) and 11 (compressed once, ahead of time).

50,000 rowsJSONjalapenojsondifference
repetitive, raw5.55 MB2.40 MB57% smaller
repetitive, gzip609 KB430 KB29% smaller
repetitive, brotli 5609 KB375 KB38% smaller
repetitive, brotli 11460 KB323 KB30% smaller
high-entropy, raw6.27 MB3.00 MB52% smaller
high-entropy, gzip2.27 MB1.90 MB16% smaller
high-entropy, brotli 52.20 MB1.79 MB19% smaller
high-entropy, brotli 112.01 MB1.68 MB16% smaller
nested orders, raw12.04 MB5.49 MB54% smaller
nested orders, gzip1.78 MB1.43 MB20% smaller
nested orders, brotli 51.72 MB1.35 MB22% smaller
nested orders, brotli 111.39 MB1.08 MB22% smaller

JavaScript

JSON.parse and JSON.stringify against decode(), view() and encode(), on Node 22.22.0. Warmed up: the fastest run once the reader has run for 200 ms, which is what a server or a page that reads many documents sees.

  • read every value builds every row as an object: JSON.parse against decode().
  • read every value, as columns ends with one array per column: JSON.parse and a pass per column, against view() and column().
  • read one number column ends with the values of price: JSON.parse and a pass, against view() and numbers(). numbers() is how a number column is read in JavaScript: it checks that every value is finite and hands back a Float64Array. That is a view over the document's own bytes when the column starts at a multiple of 8 in memory, and a copy otherwise, since JavaScript makes a Float64Array only there. In both documents price starts at a byte that is not a multiple of 8, so it is a copy.
  • read one text column ends with the values of city: JSON.parse and a pass, against view() and column().
  • read one row ends with each value of the middle row, in column order: JSON.parse and Object.values() of that row, against view() and a get() per column, which builds no row object.
  • write every value turns the rows each reader built back into bytes: JSON.stringify and a TextEncoder, against encode().
50,000 rowsdataJSONjalapenojsondifference
read every valuerepetitive47.3 ms12.9 ms3.7x faster
high-entropy45.6 ms12.4 ms3.7x faster
read every value, as columnsrepetitive58.0 ms11.2 ms5.2x faster
high-entropy57.9 ms10.5 ms5.5x faster
read one number columnrepetitive49.8 ms0.099 ms501x faster
high-entropy50.0 ms0.110 ms456x faster
read one text columnrepetitive49.5 ms4.71 ms11x faster
high-entropy49.3 ms2.25 ms22x faster
read one rowrepetitive47.3 ms0.0035 ms13,602x faster
high-entropy46.4 ms0.0036 ms12,929x faster
write every valuerepetitive29.7 ms9.96 ms3.0x faster
high-entropy28.2 ms11.9 ms2.4x faster

JSON's time includes turning the bytes into the string JSON.parse takes, because jalapenojson's includes reading the same bytes. Handed a string it already has, JSON.parse alone takes 31.5 ms on the repetitive rows and 41.3 ms on the high-entropy rows at 50,000 rows.

Parsed once, then read

Every table above times the parse with the reading, which is what reading a document once costs. A process that keeps a document and reads it many times pays for the parse once and then for the reading alone, so here the parse runs once, before the clock starts, and every run reads from what it made. JSON.parse makes rows that are objects already, while view() reads the header and converts each value from the document's bytes when it is asked for, so a text value is decoded, and a date spelled out, on every read. A JavaScript string cannot point into the document's bytes, so every text value read is made into a new string, where JSON.parse made each one once. A number column makes one typed array per read: numbers() views the document's own bytes when the column starts at a multiple of 8 in memory, and copies them otherwise, as it does for price here. The first line is the parse alone. The last column says after how many reads JSON's total, its parse and then its reads, comes out the smaller, or never, where jalapenojson's reads are the quicker too. Reading every value as rows is not here: JSON.parse's rows are that already, so nothing would be left to time, and decode() builds the same rows once, after which the two are the same objects.

50,000 rows, parsed oncedataJSONjalapenojsondifferenceJSON catches up
parse itrepetitive47.3 ms0.0028 ms17,154x faster
high-entropy45.6 ms0.0028 ms16,502x faster
then read every value, as columnsrepetitive7.94 ms11.2 ms1.4x slowerafter 15 reads
high-entropy8.02 ms10.5 ms1.3x slowerafter 19 reads
then read one number columnrepetitive1.34 ms0.097 ms14x fasternever
high-entropy1.12 ms0.100 ms11x fasternever
then read one text columnrepetitive0.735 ms4.66 ms6.3x slowerafter 13 reads
high-entropy0.766 ms2.20 ms2.9x slowerafter 32 reads
then read one rowrepetitive0.00014 ms0.00056 ms3.9x slowerafter 110,000 reads
high-entropy0.00014 ms0.00059 ms4.1x slowerafter 100,000 reads
1,000 rows, parsed oncedataJSONjalapenojsondifferenceJSON catches up
parse itrepetitive0.801 ms0.0028 ms290x faster
high-entropy0.555 ms0.0028 ms197x faster
then read every value, as columnsrepetitive0.066 ms0.155 ms2.3x slowerafter 10 reads
high-entropy0.066 ms0.137 ms2.1x slowerafter 8 reads
then read one number columnrepetitive0.0036 ms0.0025 ms1.4x fasternever
high-entropy0.0036 ms0.0024 ms1.5x fasternever
then read one text columnrepetitive0.0034 ms0.063 ms19x slowerafter 14 reads
high-entropy0.0034 ms0.022 ms6.5x slowerafter 30 reads
then read one rowrepetitive0.00014 ms0.00056 ms4.0x slowerafter 1,900 reads
high-entropy0.00014 ms0.00064 ms4.5x slowerafter 1,100 reads

Decoded once, then read

The other way to keep a jalapenojson document is to decode it once, as JSON is parsed once, and keep its rows. Here decode() runs once, before the clock starts, and every run reads its rows with the code that reads JSON's above. The first line is each parse alone, the same as reading every value in the first table. The last column says after how many reads JSON's total comes out the smaller, or never, where the reads are about the same or quicker. Its rows are plain objects, as JSON.parse's are, with each date as its text.

50,000 rows, decoded oncedataJSONjalapenojsondifferenceJSON catches up
parse itrepetitive47.3 ms12.9 ms3.7x faster
high-entropy45.6 ms12.4 ms3.7x faster
then read every value, as columnsrepetitive7.94 ms7.36 ms1.1x fasternever
high-entropy8.02 ms7.45 ms1.1x fasternever
then read one number columnrepetitive1.34 ms1.27 ms1.1x fasternever
high-entropy1.12 ms1.03 ms1.1x fasternever
then read one text columnrepetitive0.735 ms0.621 ms1.2x fasternever
high-entropy0.766 ms0.623 ms1.2x fasternever
then read one rowrepetitive0.00014 ms0.00014 msabout the samenever
high-entropy0.00014 ms0.00014 msabout the samenever
1,000 rows, decoded oncedataJSONjalapenojsondifferenceJSON catches up
parse itrepetitive0.801 ms0.176 ms4.5x faster
high-entropy0.555 ms0.156 ms3.6x faster
then read every value, as columnsrepetitive0.066 ms0.067 msabout the samenever
high-entropy0.066 ms0.065 msabout the samenever
then read one number columnrepetitive0.0036 ms0.0034 ms1.1x fasternever
high-entropy0.0036 ms0.0035 msabout the samenever
then read one text columnrepetitive0.0034 ms0.0032 ms1.1x fasternever
high-entropy0.0034 ms0.0032 ms1.1x fasternever
then read one rowrepetitive0.00014 ms0.00014 msabout the samenever
high-entropy0.00014 ms0.00014 msabout the samenever

The first call

A page that reads one document reads it once, in a process that has never run the reader: V8 compiles a JavaScript reader as it goes, while JSON.parse is already machine code. Each number is the median of one run in each of several fresh processes.

1,000 rows, first calldataJSONjalapenojsondifference
read every valuerepetitive1.57 ms4.50 ms2.9x slower
high-entropy1.25 ms4.96 ms4.0x slower
read one number columnrepetitive1.62 ms1.11 ms1.5x faster
high-entropy1.41 ms1.12 ms1.3x faster
read one text columnrepetitive1.60 ms1.67 msabout the same
high-entropy1.36 ms1.66 ms1.2x slower
read one rowrepetitive1.56 ms1.13 ms1.4x faster
high-entropy1.47 ms1.29 ms1.1x faster
50,000 rows, first calldataJSONjalapenojsondifference
read every valuerepetitive72.1 ms43.3 ms1.7x faster
high-entropy71.2 ms44.2 ms1.6x faster
read one number columnrepetitive71.8 ms2.75 ms26x faster
high-entropy70.7 ms2.67 ms26x faster
read one text columnrepetitive71.4 ms12.3 ms5.8x faster
high-entropy76.2 ms11.4 ms6.7x faster
read one rowrepetitive67.2 ms1.19 ms56x faster
high-entropy71.2 ms1.34 ms53x faster

1,000 rows

1,000 rowsdataJSONjalapenojsondifference
read every valuerepetitive0.801 ms0.176 ms4.5x faster
high-entropy0.555 ms0.156 ms3.6x faster
read every value, as columnsrepetitive0.903 ms0.160 ms5.7x faster
high-entropy0.662 ms0.143 ms4.6x faster
read one number columnrepetitive0.832 ms0.0048 ms175x faster
high-entropy0.565 ms0.0050 ms113x faster
read one text columnrepetitive0.817 ms0.067 ms12x faster
high-entropy0.562 ms0.026 ms21x faster
read one rowrepetitive0.802 ms0.0035 ms228x faster
high-entropy0.533 ms0.0036 ms146x faster
write every valuerepetitive0.387 ms0.189 ms2.0x faster
high-entropy0.388 ms0.217 ms1.8x faster

In a browser

Everything above starts with the bytes in memory. A page has to receive them first. Chromium 141.0.7390.37, driven by Playwright, fetches each document from a local server that sends it gzipped, over a connection DevTools slows to a given speed and latency, and then reads it with the JavaScript section's calls: what a page that fetches one document waits for. The download is the fastest of three; the read is the first one a fresh page does, the median of several pages.

50,000 rows, fast 4G (9 Mbit/s, 85 ms)dataJSONjalapenojsondifference
receive the documentrepetitive661 ms487 ms1.4x faster
high-entropy2,144 ms1,798 ms1.2x faster
receive it and read every valuerepetitive712 ms524 ms1.4x faster
high-entropy2,192 ms1,831 ms1.2x faster
receive it and read one number columnrepetitive702 ms490 ms1.4x faster
high-entropy2,197 ms1,800 ms1.2x faster
receive it and read one rowrepetitive701 ms488 ms1.4x faster
high-entropy2,189 ms1,799 ms1.2x faster
50,000 rows, slow link (1.6 Mbit/s, 150 ms)dataJSONjalapenojsondifference
receive the documentrepetitive3,226 ms2,317 ms1.4x faster
high-entropy11,544 ms9,657 ms1.2x faster
receive it and read every valuerepetitive3,276 ms2,353 ms1.4x faster
high-entropy11,592 ms9,691 ms1.2x faster
receive it and read one number columnrepetitive3,267 ms2,320 ms1.4x faster
high-entropy11,598 ms9,660 ms1.2x faster
receive it and read one rowrepetitive3,265 ms2,318 ms1.4x faster
high-entropy11,589 ms9,659 ms1.2x faster

At 50,000 rows on fast 4G, reading every value is 7% with JSON and 7% with jalapenojson on the repetitive rows, and 2% with JSON and 2% with jalapenojson on the high-entropy rows, of what the page waits for. The rest is the download.

1,000 rows, fast 4G (9 Mbit/s, 85 ms)dataJSONjalapenojsondifference
receive the documentrepetitive100 ms97.4 msabout the same
high-entropy130 ms124 msabout the same
receive it and read every valuerepetitive101 ms101 msabout the same
high-entropy131 ms130 msabout the same
receive it and read one number columnrepetitive101 ms99.1 msabout the same
high-entropy131 ms126 msabout the same
receive it and read one rowrepetitive101 ms98.7 msabout the same
high-entropy131 ms126 msabout the same
1,000 rows, slow link (1.6 Mbit/s, 150 ms)dataJSONjalapenojsondifference
receive the documentrepetitive217 ms202 ms1.1x faster
high-entropy382 ms352 ms1.1x faster
receive it and read every valuerepetitive218 ms206 ms1.1x faster
high-entropy383 ms358 ms1.1x faster
receive it and read one number columnrepetitive218 ms204 ms1.1x faster
high-entropy383 ms354 ms1.1x faster
receive it and read one rowrepetitive218 ms203 ms1.1x faster
high-entropy383 ms354 ms1.1x faster

At 1,000 rows on fast 4G, reading every value is under 1% with JSON and 4% with jalapenojson on the repetitive rows, and under 1% with JSON and 4% with jalapenojson on the high-entropy rows, of what the page waits for. The rest is the download.

Python

json.loads and json.dumps against decode(), view() and encode(), on Python 3.13.16. The same tasks, warmed up the same way. Python's json is written in C; jalapenojson's Python reader is Python. It has no typed-array call, so read one number column is view() and column(), which converts the whole column at once. JSON is written compact and as UTF-8, the way the file it was read from was.

50,000 rowsdataJSONjalapenojsondifference
read every valuerepetitive77.7 ms45.0 ms1.7x faster
high-entropy73.3 ms61.9 ms1.2x faster
read every value, as columnsrepetitive123 ms19.1 ms6.4x faster
high-entropy119 ms30.4 ms3.9x faster
read one number columnrepetitive77.5 ms0.665 ms116x faster
high-entropy72.1 ms0.675 ms107x faster
read one text columnrepetitive85.1 ms6.25 ms14x faster
high-entropy75.2 ms5.41 ms14x faster
read one rowrepetitive74.4 ms0.033 ms2,269x faster
high-entropy68.7 ms0.033 ms2,096x faster
write every valuerepetitive62.4 ms41.0 ms1.5x faster
high-entropy67.5 ms45.0 ms1.5x faster

Parsed once, then read

The same as in JavaScript: json.loads and view() run once, before the clock starts, and the reads are the ones above with the parse taken out, but for reading every value as rows, which json.loads has done already. As in JavaScript, every text value view() reads is made into a new string, where json.loads made each one once. The first line is the parse alone. The last column says after how many reads JSON's total, its parse and then its reads, comes out the smaller, or never, where jalapenojson's reads are the quicker too.

50,000 rows, parsed oncedataJSONjalapenojsondifferenceJSON catches up
parse itrepetitive77.7 ms0.025 ms3,136x faster
high-entropy73.3 ms0.025 ms2,957x faster
then read every value, as columnsrepetitive14.6 ms19.1 ms1.3x slowerafter 18 reads
high-entropy17.1 ms29.7 ms1.7x slowerafter 6 reads
then read one number columnrepetitive3.29 ms0.619 ms5.3x fasternever
high-entropy2.50 ms0.613 ms4.1x fasternever
then read one text columnrepetitive2.48 ms6.08 ms2.4x slowerafter 22 reads
high-entropy2.25 ms5.39 ms2.4x slowerafter 24 reads
then read one rowrepetitive0.00021 ms0.0044 ms21x slowerafter 18,000 reads
high-entropy0.00021 ms0.0044 ms21x slowerafter 17,000 reads
1,000 rows, parsed oncedataJSONjalapenojsondifferenceJSON catches up
parse itrepetitive1.14 ms0.025 ms46x faster
high-entropy1.05 ms0.025 ms43x faster
then read every value, as columnsrepetitive0.187 ms0.387 ms2.1x slowerafter 6 reads
high-entropy0.188 ms0.495 ms2.6x slowerafter 4 reads
then read one number columnrepetitive0.030 ms0.013 ms2.3x fasternever
high-entropy0.028 ms0.013 ms2.1x fasternever
then read one text columnrepetitive0.028 ms0.090 ms3.2x slowerafter 19 reads
high-entropy0.027 ms0.078 ms2.9x slowerafter 21 reads
then read one rowrepetitive0.00021 ms0.0044 ms22x slowerafter 270 reads
high-entropy0.00021 ms0.0044 ms21x slowerafter 250 reads

Decoded once, then read

The other way to keep a jalapenojson document is to decode it once, as JSON is parsed once, and keep its rows. Here decode() runs once, before the clock starts, and every run reads its rows with the code that reads JSON's above. The first line is each parse alone, the same as reading every value in the first table. The last column says after how many reads JSON's total comes out the smaller, or never, where the reads are about the same or quicker. Its rows are dicts, as json.loads's are, with each date as a date where JSON's is text.

50,000 rows, decoded oncedataJSONjalapenojsondifferenceJSON catches up
parse itrepetitive77.7 ms45.0 ms1.7x faster
high-entropy73.3 ms61.9 ms1.2x faster
then read every value, as columnsrepetitive14.6 ms13.0 ms1.1x fasternever
high-entropy17.1 ms13.7 ms1.2x fasternever
then read one number columnrepetitive3.29 ms1.45 ms2.3x fasternever
high-entropy2.50 ms1.49 ms1.7x fasternever
then read one text columnrepetitive2.48 ms1.50 ms1.7x fasternever
high-entropy2.25 ms1.49 ms1.5x fasternever
then read one rowrepetitive0.00021 ms0.00021 msabout the samenever
high-entropy0.00021 ms0.00021 msabout the samenever
1,000 rows, decoded oncedataJSONjalapenojsondifferenceJSON catches up
parse itrepetitive1.14 ms0.717 ms1.6x faster
high-entropy1.05 ms0.837 ms1.3x faster
then read every value, as columnsrepetitive0.187 ms0.189 msabout the samenever
high-entropy0.188 ms0.189 msabout the samenever
then read one number columnrepetitive0.030 ms0.027 ms1.1x fasternever
high-entropy0.028 ms0.028 msabout the samenever
then read one text columnrepetitive0.028 ms0.027 msabout the samenever
high-entropy0.027 ms0.027 msabout the samenever
then read one rowrepetitive0.00021 ms0.00021 msabout the samenever
high-entropy0.00021 ms0.00021 msabout the samenever

1,000 rows

1,000 rowsdataJSONjalapenojsondifference
read every valuerepetitive1.14 ms0.717 ms1.6x faster
high-entropy1.05 ms0.837 ms1.3x faster
read every value, as columnsrepetitive1.36 ms0.426 ms3.2x faster
high-entropy1.29 ms0.537 ms2.4x faster
read one number columnrepetitive1.17 ms0.041 ms29x faster
high-entropy1.08 ms0.040 ms27x faster
read one text columnrepetitive1.17 ms0.120 ms9.7x faster
high-entropy1.07 ms0.109 ms9.8x faster
read one rowrepetitive1.13 ms0.033 ms35x faster
high-entropy1.04 ms0.032 ms32x faster
write every valuerepetitive1.20 ms0.663 ms1.8x faster
high-entropy1.27 ms0.708 ms1.8x faster

C

cJSON, the library most C code uses, and yyjson, one of the fastest JSON parsers there is, against jj_parse() and the accessors. Each run parses and then reads what the task asks for. The JSON parsers hand back a number as a double and text as a pointer and a length, and a date is text to them. jalapenojson finds each value with jj_field(), by arithmetic, and reads it with the accessor for its type: jj_int() for an integer, which has nothing to check; jj_float_checked() for a float, which refuses a NaN or an infinity; jj_str_checked() for text, which checks that it is UTF-8, as yyjson does while it parses, and leaves it as a pointer and a length; and jj_date_d() for a date, which checks its range and hands back its year, month and day. There is no C encoder, so there is no write task.

50,000 rowsdatacJSONyyjsonjalapenojsonvs cJSONvs yyjson
read every valuerepetitive58.1 ms8.63 ms3.67 ms16x faster2.4x faster
high-entropy61.3 ms9.56 ms5.06 ms12x faster1.9x faster
read one number columnrepetitive59.5 ms7.95 ms0.150 ms397x faster53x faster
high-entropy62.5 ms8.74 ms0.150 ms417x faster58x faster
read one text columnrepetitive60.6 ms7.91 ms1.10 ms55x faster7.2x faster
high-entropy58.2 ms9.60 ms1.17 ms50x faster8.2x faster
read one rowrepetitive57.2 ms7.07 ms0.00035 ms164,394x faster20,318x faster
high-entropy62.0 ms8.63 ms0.00036 ms173,645x faster24,187x faster

Parsed once, then read

Every table above times the parse with the reading, which is what reading a document once costs. A process that keeps a document and reads it many times pays for the parse once and then for the reading alone, so here the parse runs once, before the clock starts, and every run reads from what it made. Every run reads with the accessors above, so jalapenojson still checks each value as it reads it, where cJSON and yyjson checked theirs while they parsed. Neither keeps an index of an array's values, so finding the middle row walks half of the rows, parsed or not. The first line is the parse alone. The last two columns say, for cJSON and for yyjson, after how many reads JSON's total, its parse and then its reads, comes out the smaller, or never, where jalapenojson's reads are the quicker too.

50,000 rows, parsed oncedatacJSONyyjsonjalapenojsonvs cJSONvs yyjsoncJSON catches upyyjson catches up
parse itrepetitive50.2 ms7.31 ms0.00029 ms170,686x faster24,857x faster
high-entropy52.4 ms7.96 ms0.00030 ms177,613x faster26,970x faster
then read every valuerepetitive6.75 ms1.09 ms3.67 ms1.8x faster3.4x slowerneverafter 3 reads
high-entropy6.70 ms0.897 ms5.09 ms1.3x faster5.7x slowerneverafter 2 reads
then read one number columnrepetitive5.70 ms0.634 ms0.150 ms38x faster4.2x fasternevernever
high-entropy6.13 ms0.576 ms0.150 ms41x faster3.9x fasternevernever
then read one text columnrepetitive4.32 ms0.562 ms1.10 ms3.9x faster2.0x slowerneverafter 14 reads
high-entropy4.37 ms0.601 ms1.17 ms3.7x faster1.9x slowerneverafter 15 reads
then read one rowrepetitive1.36 ms0.254 ms0.000052 ms26,138x faster4,880x fasternevernever
high-entropy1.38 ms0.256 ms0.000059 ms23,458x faster4,346x fasternevernever
1,000 rows, parsed oncedatacJSONyyjsonjalapenojsonvs cJSONvs yyjsoncJSON catches upyyjson catches up
parse itrepetitive0.627 ms0.097 ms0.00029 ms2,163x faster334x faster
high-entropy0.662 ms0.106 ms0.00029 ms2,274x faster363x faster
then read every valuerepetitive0.024 ms0.020 ms0.070 ms2.9x slower3.4x slowerafter 14 readsafter 2 reads
high-entropy0.027 ms0.017 ms0.090 ms3.4x slower5.3x slowerafter 11 readsafter 2 reads
then read one number columnrepetitive0.021 ms0.0085 ms0.0030 ms7.1x faster2.8x fasternevernever
high-entropy0.021 ms0.0072 ms0.0030 ms6.9x faster2.4x fasternevernever
then read one text columnrepetitive0.015 ms0.0059 ms0.015 msabout the same2.5x slowerneverafter 11 reads
high-entropy0.015 ms0.0059 ms0.018 ms1.2x slower3.0x slowerafter 240 readsafter 9 reads
then read one rowrepetitive0.0054 ms0.00092 ms0.000055 ms97x faster17x fasternevernever
high-entropy0.0053 ms0.00092 ms0.000068 ms78x faster14x fasternevernever

1,000 rows

1,000 rowsdatacJSONyyjsonjalapenojsonvs cJSONvs yyjson
read every valuerepetitive0.659 ms0.118 ms0.070 ms9.4x faster1.7x faster
high-entropy0.694 ms0.123 ms0.090 ms7.8x faster1.4x faster
read one number columnrepetitive0.648 ms0.106 ms0.0033 ms198x faster32x faster
high-entropy0.689 ms0.112 ms0.0033 ms210x faster34x faster
read one text columnrepetitive0.639 ms0.102 ms0.015 ms42x faster6.7x faster
high-entropy0.683 ms0.111 ms0.018 ms39x faster6.3x faster
read one rowrepetitive0.632 ms0.098 ms0.00035 ms1,816x faster281x faster
high-entropy0.670 ms0.106 ms0.00036 ms1,841x faster292x faster

WebAssembly

The WebAssembly sections were not measured for this version, because the machine that ran the benchmark has clang 18.1.3 and wasm-ld, but not wasi-libc or compiler-rt's wasm32 builtins, which the two WebAssembly modules are built against, so neither could be built. bench/wasm.c, the C reader's calls for JavaScript, was compiled for the machine all the same, to check that it still builds against c/jalapenojson.h, but it was not run. The WebAssembly numbers published for format 0.6 measured a reader of a format since replaced, so they are not carried over.

How it was measured

  • Each number comes from its own process, started for that one measurement, so no reader runs in a process another reader has warmed.
  • Warmed up means the task ran until it had run for 200 ms, and then the fastest of at least 15 more runs and at least 500 ms was kept. The number shown is the median of that over 5 rounds, each of which ran every measurement once, in a different order.
  • Parsed once, and decoded once, mean the parse ran once, before the clock started, and every timed run read from what it made. Such a read can take a few nanoseconds, less than reading the clock does, so those runs are timed in batches of as many as take 0.1 ms, and a run's time is its batch's divided by how many it held. In C the compiler is told between reads that memory may have changed, so that each one reads the document again. Where a table says when JSON catches up, that is worked out from the table's own numbers.
  • Every run's result is checked: a count of the values it read, their sum, and a CRC-32 of their text, against the same worked out from the rows the files were written from. A run that read something else stops the benchmark.
  • The input is bytes in memory for both formats. Freeing memory is not timed in C; in JavaScript and Python the garbage collector runs when it runs.
  • jalapenojson checks every date it reads, in every language. JavaScript gets its canonical text, such as 2025-03-04, Python a date object, and C its year, month and day from jj_date_d(). JSON has no dates, so its readers hand the same values back as unchecked strings. The checksum counts every date as its canonical text, spelled out after the clock stops from what each reader handed back.