Skip to content

Benchmarks

Every benchmark table, measured on one Linux server: ts-bin-rpc against JSON, Arrow JS, Flechette and Colyseus, streams over HTTP and WebSocket, middleware, queries and sizes.

The full tables behind Performance, which explains what they mean for an app. Speed was measured on a rented Linux server with an Intel Xeon (Icelake): Node 26.13, and headless Chromium 156, Firefox 157 and WebKit 27.2 through Playwright, each run in a fresh process or browser. Every table names its date and the commit it measured.

How to read the speed tables: a group compares variants that do the same work; the ratio is speed relative to the first variant of the group, JSON unless the group says otherwise, so higher is better. ~ marks a row whose ratio ranged over 25% between runs. On the site, within each group green marks the best value of a column, light green the second and red the worst, for times and bytes alike; a column whose values differ by less than 5% is left plain. Data is synthetic, from bench/lib/data.mjs, with 30% of names in Cyrillic.

The bench workflow also runs the JSON suite on GitHub Actions for every release and publishes it to bench/results/ci; shared runners move absolute times by tens of percent, so this page uses the server.

Generated codecs against JSON.parse over the same bytes decoded with TextDecoder, which is what response.json() does, and against JSON.stringify for encoding. Source: server/generated.md.

Hand-written for this type is the ceiling, not a competitor: the same columnar layout written by hand for User[] alone (bench/lib/codec3.mjs), the prototype the format was chosen from. It has no column catalog, verification, optional fields or schema evolution, so the distance to generated is what those cost: up to 25% on reads, close to nothing in WebKit.

2026-11-07, Intel Xeon Processor (Icelake), linux 6.8.0-147-generic, commit 491f807. Median of 10 runs per runtime, each in a fresh process or browser; ratio is speed relative to the first variant of the group, the median over the runs; ~ marks rows whose ratio ranged over 25% between runs.

  • node: node v26.13.0
  • chromium: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/156.0.8078.4 Safari/537.36
  • firefox: Mozilla/5.0 (X11; Linux x86_64; rv:157.0) Gecko/20100101 Firefox/157.0
  • webkit: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/27.2 Safari/605.1.15
GroupVariantnodechromiumfirefoxwebkit
10 users, all fieldsJSON6.14 µs4.59 µs6.91 µs5.25 µs
10 users, all fieldshand-written for this type2.32 µs (2.64x)2.37 µs (1.94x)4.14 µs (1.67x)3.53 µs (1.49x)
10 users, all fieldsgenerated2.91 µs (2.11x)2.93 µs (1.58x)4.67 µs (1.48x)3.60 µs (1.46x)
10 users, all fieldsgenerated + verify3.55 µs (1.74x)3.57 µs (1.29x)5.77 µs (1.20x)4.27 µs (1.23x)
10 users, all fieldsgenerated, decode (plain)2.80 µs (2.20x)2.87 µs (1.60x)4.74 µs (1.47x)3.58 µs (1.46x)
1000 users, all fieldsJSON573 µs635 µs613 µs607 µs
1000 users, all fieldshand-written for this type122 µs (4.70x)120 µs (5.30x)134 µs (4.56x)130 µs (4.62x)
1000 users, all fieldsgenerated138 µs (4.17x)159 µs (4.00x)154 µs (4.00x)131 µs (4.58x)
1000 users, all fieldsgenerated + verify151 µs (3.80x)174 µs (3.65x)178 µs (3.45x)143 µs (4.12x)
1000 users, all fieldsgenerated, decode (plain)106 µs (5.37x)121 µs (5.26x)156 µs (3.93x)130 µs (4.60x)
1000 users, 2 fieldsJSON567 µs633 µs610 µs590 µs
1000 users, 2 fieldshand-written for this type48 µs (11.88x)60 µs (10.63x)68 µs (8.92x)84 µs (7.07x)
1000 users, 2 fieldsgenerated56 µs (10.14x)67 µs (9.29x)72 µs (8.45x)83 µs (7.06x)
1000 users, 2 fieldsgenerated + verify70 µs (8.10x)81 µs (7.76x)96 µs (6.34x)98 µs (6.09x)
1000 users, 2 fieldsgenerated, decode (plain)102 µs (5.57x)115 µs (5.49x)151 µs (4.02x)125 µs (4.73x)
1000 users, numbers onlyJSON564 µs630 µs600 µs604 µs
1000 users, numbers onlyhand-written for this type21 µs (27.52x)19 µs (32.85x)19 µs (31.75x)20 µs (31.00x)
1000 users, numbers onlygenerated26 µs (21.41x)24 µs (26.13x)22 µs (27.78x)20 µs (29.90x)
1000 users, numbers onlygenerated + verify47 µs (11.92x)57 µs (11.10x)53 µs (11.46x)74 µs (8.12x)
1000 users, numbers onlygenerated, decode (plain)104 µs (5.48x)114 µs (5.51x)152 µs (3.94x)135 µs (4.48x)
1 user, all fieldsJSON0.98 µs0.95 µs1.20 µs1.04 µs
1 user, all fieldsgenerated0.78 µs (1.26x)0.83 µs (1.14x)1.34 µs (0.90x)1.07 µs (0.96x)
1 user, all fieldsgenerated + verify1.04 µs (0.94x)1.04 µs (0.91x)1.81 µs (0.66x)1.38 µs (0.76x)
page of 1000 users, all fieldsJSON574 µs637 µs601 µs592 µs
page of 1000 users, all fieldsgenerated121 µs (4.73x)137 µs (4.66x)152 µs (3.95x)132 µs (4.51x)
page of 1000 users, all fieldsgenerated, decode (plain)111 µs (5.22x)125 µs (5.10x)156 µs (3.84x)133 µs (4.45x)
500 products (long text), all fieldsJSON383 µs222 µs492 µs327 µs
500 products (long text), all fieldsgenerated86 µs (4.42x)94 µs (2.38x)164 µs (3.01x)105 µs (3.10x)
500 products (long text), all fieldsgenerated + verify108 µs (3.55x)115 µs (1.93x)196 µs (2.52x)129 µs (2.54x)
100k points, every valueJSON, number arrays19.2 ms17.1 ms28.9 ms20.2 ms
100k points, every valuegenerated790 µs (24.94x)905 µs (18.99x)230 µs (125.96x)861 µs (23.45x)
100k points, every valuegenerated + verify790 µs (24.30x)918 µs (18.74x)229 µs (126.07x)861 µs (23.40x)
encode 1000 usersJSON359 µs932 µs557 µs463 µs
encode 1000 usershand-written for this type364 µs (0.98x) ~364 µs (2.56x)376 µs (1.49x)202 µs (2.31x)
encode 1000 usersgenerated298 µs (1.19x) ~353 µs (2.65x)376 µs (1.48x)246 µs (1.90x)
encode 500 productsJSON184 µs593 µs370 µs508 µs
encode 500 productsgenerated255 µs (0.70x)576 µs (1.03x)347 µs (1.07x)470 µs (1.07x)
encode 100k pointsJSON, number arrays19.6 ms36.3 ms48.6 ms30.2 ms
encode 100k pointsgenerated487 µs (40.28x) ~998 µs (36.42x)1.1 ms (43.56x)1.1 ms (28.35x)

Tables and series against Apache Arrow JS and Flechette, game state and its patches against Colyseus schema. Source: libs.md.

2026-11-07, Intel Xeon Processor (Icelake), linux 6.8.0-147-generic, commit 491f807. Median of 5 runs per runtime, each in a fresh process or browser; ratio is speed relative to the first variant of the group, the median over the runs; ~ marks rows whose ratio ranged over 25% between runs.

  • node: node v26.13.0
  • chromium: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/156.0.8078.4 Safari/537.36
  • firefox: Mozilla/5.0 (X11; Linux x86_64; rv:157.0) Gecko/20100101 Firefox/157.0
  • webkit: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/27.2 Safari/605.1.15
GroupVariantnodechromiumfirefoxwebkit
1000 users, encode from rowsJSON324 µs714 µs569 µs468 µs
1000 users, encode from rowsts-bin-rpc309 µs (1.04x)405 µs (1.74x)383 µs (1.51x)256 µs (1.89x)
1000 users, encode from rowsArrow JS2.7 ms (0.12x)4.0 ms (0.18x)2.0 ms (0.29x)1.9 ms (0.25x)
1000 users, encode from rowsFlechette1.8 ms (0.18x)3.9 ms (0.18x)981 µs (0.58x)1.7 ms (0.30x)
1000 users, decode and read every fieldJSON578 µs474 µs607 µs638 µs
1000 users, decode and read every fieldts-bin-rpc, views118 µs (4.89x)150 µs (3.16x)157 µs (3.86x)189 µs (3.38x)
1000 users, decode and read every fieldts-bin-rpc, views + verify129 µs (4.50x)165 µs (2.86x)179 µs (3.43x)205 µs (3.14x)
1000 users, decode and read every fieldArrow JS, columns1.1 ms (0.52x)1.3 ms (0.36x)1.8 ms (0.34x)1.4 ms (0.45x)
1000 users, decode and read every fieldFlechette, columns674 µs (0.86x)979 µs (0.48x)1.2 ms (0.53x)1.0 ms (0.58x)
1000 users, decode and read every fieldFlechette, row objects913 µs (0.63x)1.2 ms (0.39x)1.8 ms (0.34x)1.2 ms (0.52x)
1000 users, decode and read the numbersJSON586 µs455 µs599 µs592 µs
1000 users, decode and read the numbersts-bin-rpc, columns15 µs (39.97x)11 µs (40.76x)21 µs (29.64x)18 µs (33.27x)
1000 users, decode and read the numbersArrow JS, columns41 µs (14.48x)34 µs (13.05x)52 µs (11.37x)48 µs (12.30x)
1000 users, decode and read the numbersFlechette, columns26 µs (22.33x)19 µs (23.14x)29 µs (20.43x)23 µs (25.83x)
100k points, encodeJSON, number arrays21.0 ms55.4 ms114.4 ms47.3 ms
100k points, encodets-bin-rpc858 µs (24.73x) ~1.0 ms (55.03x)1.3 ms (86.82x)1.1 ms (43.78x)
100k points, encodeArrow JS887 µs (24.58x) ~1.1 ms (49.13x)1.5 ms (78.69x)1.2 ms (40.24x)
100k points, encodeFlechette829 µs (25.62x)1.1 ms (51.51x)1.1 ms (107.80x)1.1 ms (44.04x)
100k points, decode and read every valueJSON, number arrays24.8 ms24.9 ms45.9 ms24.7 ms
100k points, decode and read every valuets-bin-rpc + verify362 µs (68.59x)372 µs (67.01x)261 µs (176.20x)739 µs (33.94x)
100k points, decode and read every valueArrow JS644 µs (38.44x)646 µs (38.41x)321 µs (143.58x)804 µs (31.22x)
100k points, decode and read every valueFlechette614 µs (40.26x)625 µs (39.82x)278 µs (166.95x)752 µs (32.82x)
100 entities, full state: encode and decodeJSON95 µs91 µs169 µs137 µs
100 entities, full state: encode and decodets-bin-rpc27 µs (3.49x)28 µs (3.30x)37 µs (4.57x)24 µs (5.66x)
100 entities, full state: encode and decodeColyseus schema367 µs (0.26x)295 µs (0.31x)457 µs (0.37x)285 µs (0.48x)
100 entities, 5 move: patch encode, decode and applyJSON4.90 µs6.06 µs7.06 µs4.49 µs
100 entities, 5 move: patch encode, decode and applyts-bin-rpc3.13 µs (1.56x)2.95 µs (2.05x)5.67 µs (1.24x)2.76 µs (1.62x)
100 entities, 5 move: patch encode, decode and applyColyseus schema5.99 µs (0.81x)4.85 µs (1.22x)7.72 µs (0.91x)4.26 µs (1.06x)
1000 entities, full state: encode and decodeJSON1.0 ms1.0 ms1.7 ms1.2 ms
1000 entities, full state: encode and decodets-bin-rpc241 µs (4.21x)250 µs (4.06x)328 µs (5.24x)189 µs (6.63x)
1000 entities, full state: encode and decodeColyseus schema3.8 ms (0.26x)3.0 ms (0.34x)4.7 ms (0.36x)2.9 ms (0.43x)
1000 entities, 50 move: patch encode, decode and applyJSON30 µs31 µs49 µs29 µs
1000 entities, 50 move: patch encode, decode and applyts-bin-rpc7.48 µs (3.97x)7.31 µs (4.27x)12 µs (4.20x)6.51 µs (4.45x)
1000 entities, 50 move: patch encode, decode and applyColyseus schema52 µs (0.56x)43 µs (0.71x)73 µs (0.67x)39 µs (0.75x)

From node bench/node/libs-size.mjs; gzip level 6. Arrow and Flechette send strings as plain Utf8, Colyseus a map of entities by id.

MessageFormatBytesgzip
1000 usersJSON132 KB23 KB
1000 usersts-bin-rpc64 KB21 KB
1000 usersArrow JS75 KB28 KB
1000 usersFlechette75 KB28 KB
100k pointsJSON7010 KB1722 KB
100k pointsts-bin-rpc1953 KB1303 KB
100k pointsArrow JS1954 KB1303 KB
100k pointsFlechette1954 KB1303 KB
100 entities, full stateJSON14 KB4.9 KB
100 entities, full statets-bin-rpc3.4 KB2.3 KB
100 entities, full stateColyseus schema4.6 KB3.3 KB
100 entities, 5 move: patchJSON323 B196 B
100 entities, 5 move: patchts-bin-rpc180 B151 B
100 entities, 5 move: patchColyseus schema75 B98 B
1000 entities, full stateJSON138 KB49 KB
1000 entities, full statets-bin-rpc34 KB22 KB
1000 entities, full stateColyseus schema52 KB35 KB
1000 entities, 50 move: patchJSON3.1 KB1.3 KB
1000 entities, 50 move: patchts-bin-rpc824 B694 B
1000 entities, 50 move: patchColyseus schema750 B694 B
  • Arrow JS and Flechette read columns, their fastest way; ts-bin-rpc reads views of rows, the way an app does, and its numbers through columnsOf. Flechette's row objects are its toArray().
  • The ts-bin-rpc patches are the frames of live state (LiveDelta), encoded and decoded by the generated code; the bookkeeping of live() that finds the changed fields is not in them. Colyseus finds changes in its setters, so its rows include that.
  • Small patches are where ts-bin-rpc loses on bytes: a message carries a header with the string blocks, a row table, a column catalog and bitmaps, about 110 of the 180 bytes of 5 moves. Since 491f807 the writer leaves out the columns no row has (FORMAT §6); before, the same patch took 232 bytes and 30–45% longer.

A Node server streams ticks to a Chromium page over HTTP and over a WebSocket, against NDJSON, SSE and JSON over a WebSocket. Source: server/stream-transport.md.

On the server the row of ts-bin-rpc over a WebSocket with window: 0 spread on 0.6.0: page main thread from 118 to 268 ms at 1 000 ticks/s over four runs, against 111–119 ms on 0.5.1. On an Apple M3, 18 runs of each version in turn gave 54–74 ms for both, so the spread is put down to that machine. The row itself is real: at this load it stays slower than JSON over a WebSocket, about 56 against 41 ms on the M3.

2026-11-07, Intel Xeon Processor (Icelake), linux 6.8.0-147-generic, Node v26.13.0, Chromium 156.0.8078.4. Median of 5 runs.

A Node HTTP server on 127.0.0.1 sends ticks { t: f64, price: f32, size: u32, side: 'buy' | 'sell' }; a Chromium page reads every field of every tick. Every transport gets the same producer: on a 1 ms timer it makes every tick that is due (at full speed, bursts of 1000 per macrotask), and NDJSON, SSE and JSON over a WebSocket write once per timer tick, not once per tick (JSON: one text message with an array of the ticks). ts-bin-rpc batches by its window: 16 ms by default, or at the end of each task with window: 0. The WebSocket server is the small one of the tests (e2e/src/ws-server.ts), without compression; the ts-bin-rpc socket stays open between runs.

  • Delay: the page's clock minus the send time in the tick; both clocks are of the same machine.
  • Page main thread: TaskDuration of the page's renderer from the Chrome DevTools Protocol, including the decoding and the reading of the ticks.
  • Server CPU: user and system time of the server process, which also runs the Playwright driver.
  • Bytes: what the server wrote to the socket, headers included (for WebSockets, frame headers), without compression.
LoadTransportWallDelay p50Delay p99Page main threadServer CPUBytes
1 000 ticks/s for 5 sts-bin-rpc, window 16 ms (default)5002 ms9.09 ms16.8 ms35.7 ms93.2 ms105 KB
1 000 ticks/s for 5 sts-bin-rpc, window 05002 ms0.08 ms0.11 ms125 ms289 ms394 KB
1 000 ticks/s for 5 sNDJSON over fetch5001 ms0.08 ms0.13 ms159 ms204 ms337 KB
1 000 ticks/s for 5 sSSE, EventSource5001 ms0.07 ms0.10 ms111 ms213 ms371 KB
1 000 ticks/s for 5 sts-bin-rpc over WebSocket, window 16 ms5000 ms8.91 ms17.2 ms35.4 ms65.4 ms107 KB
1 000 ticks/s for 5 sts-bin-rpc over WebSocket, window 05000 ms0.07 ms0.11 ms166 ms315 ms436 KB
1 000 ticks/s for 5 sJSON over WebSocket5002 ms0.06 ms0.09 ms92.4 ms255 ms327 KB
20 000 ticks/s for 3 sts-bin-rpc, window 16 ms (default)3003 ms9.25 ms16.9 ms77.6 ms64.5 ms1010 KB
20 000 ticks/s for 3 sts-bin-rpc, window 03003 ms0.10 ms0.15 ms130 ms214 ms1.2 MB
20 000 ticks/s for 3 sNDJSON over fetch3002 ms0.11 ms0.18 ms172 ms204 ms3.7 MB
20 000 ticks/s for 3 sSSE, EventSource3002 ms0.15 ms0.94 ms441 ms791 ms4.1 MB
20 000 ticks/s for 3 sts-bin-rpc over WebSocket, window 16 ms3001 ms9.23 ms16.9 ms73.7 ms71.3 ms1011 KB
20 000 ticks/s for 3 sts-bin-rpc over WebSocket, window 03001 ms0.08 ms0.16 ms144 ms188 ms1.2 MB
20 000 ticks/s for 3 sJSON over WebSocket3003 ms0.09 ms0.13 ms134 ms184 ms3.7 MB
200 000 ticks, as fast as possiblets-bin-rpc, window 16 ms (default)102 ms33.2 ms62.1 ms134 ms43.9 ms3.3 MB
200 000 ticks, as fast as possiblets-bin-rpc, window 0100 ms34.1 ms60.9 ms133 ms41.2 ms3.3 MB
200 000 ticks, as fast as possibleNDJSON over fetch202 ms67.9 ms121 ms253 ms86.0 ms12.2 MB
200 000 ticks, as fast as possibleSSE, EventSource1972 ms890 ms1877 ms1161 ms2228 ms13.6 MB
200 000 ticks, as fast as possiblets-bin-rpc over WebSocket, window 16 ms122 ms39.6 ms72.0 ms148 ms58.8 ms3.3 MB
200 000 ticks, as fast as possiblets-bin-rpc over WebSocket, window 0121 ms40.3 ms76.1 ms144 ms55.9 ms3.3 MB
200 000 ticks, as fast as possibleJSON over WebSocket213 ms69.1 ms132 ms197 ms110 ms12.2 MB

Source: server/middleware.md.

2026-11-07, Intel Xeon Processor (Icelake), linux 6.8.0-147-generic, Node v26.13.0. Median of 9 rounds of 200,000 sequential awaited calls.

The procedure takes no input and returns nothing, so the handler column is routing, Request and Response without a codec. Context steps return a new object, as { ...ctx, user } does; the around step reads the clock twice.

ChainCalling the procedureThrough createHandler
no middleware53 ns6.77 µs
1 context step102 ns (+49 ns)6.84 µs (+64 ns)
1 async context step207 ns (+154 ns)7.07 µs (+299 ns)
1 around327 ns (+274 ns)7.25 µs (+475 ns)
around + 2 context steps407 ns (+353 ns)7.42 µs (+646 ns)

Source: server/query.md.

2026-11-07, Intel Xeon Processor (Icelake), linux 6.8.0-147-generic, Node v26.13.0. Median of 9 rounds of 50,000 sequential awaited calls.

Client and handler in one process, no network: what a call costs on both sides together. The two procedures take { id: u32 } and return the same 7-field user. The GET call also encodes the input as base64url, builds and parses the URL, and hashes the response for its ETag. The 304 row is the handler alone answering a request whose If-None-Match matches: the procedure still runs, the body is not sent.

CallTimeOver POST
POST, user.get20.85 µs
GET, catalog.user20.43 µs−0.42 µs
GET, catalog.user, 30410.70 µs−10.15 µs

Sizes do not depend on the machine. Source: generated-size.md.

2026-11-07. Bytes of ts-bin-rpc, % against JSON compressed the same way. JSON values are those of bench/lib/data.mjs: numbers rounded to 1–3 decimals. The binary series stores float32/float64.

Payloadrawgzip-6brotli-4brotli-6brotli-11zstd-3
1000 users65240 (-52%)21850 (-8%)19731 (-18%)17553 (-19%)16033 (-11%)23010 (-6%)
500 products, long text130374 (-18%)34740 (0%)36879 (-9%)32787 (-9%)29227 (-4%)37164 (-3%)
20 users1698 (-37%)1011 (+10%)1012 (+13%)938 (+10%)893 (+21%)1032 (+10%)
100k points, JSON as number arrays2000068 (-51%)1334477 (-1%)1213570 (+9%)1247731 (+12%)1037362 (+3%)1314874 (+2%)
100k points, JSON as an array of objects2000068 (-66%)1334477 (-21%)1213570 (-24%)1247731 (-24%)1037362 (-20%)1314874 (-27%)

Source: size.md.

esbuild 0.28.2, minified ESM, gzip -9. Generated code: the bundle minus the runtime-only bundle of the same side; for the inputSchema row, what the validator, inputRules and the formats add to the e2e client.

SchemaSideBundle, minBundle, min + gzGenerated code, min + gz
runtime onlyclient12.7 KB5.3 KB—
runtime onlyserver25.5 KB10.0 KB—
playgroundclient33.4 KB11.2 KB5.8 KB
playgroundserver48.1 KB16.4 KB6.4 KB
e2eclient85.3 KB19.7 KB14.3 KB
e2eserver102.5 KB24.7 KB14.7 KB
example dashboardclient43.3 KB13.3 KB7.9 KB
example dashboardserver55.5 KB17.2 KB7.2 KB
cli fixture "supported"client44.6 KB13.3 KB8.0 KB
cli fixture "supported"server64.2 KB20.1 KB10.1 KB
e2e, every input through inputSchemaclient92.5 KB21.7 KB2.1 KB
Terminal window
pnpm --filter @tbr/bench gen && node bench/run.mjs generated # Node, Chromium, Firefox, WebKit
node bench/gen/libs.mjs && node bench/run.mjs libs # against Arrow, Flechette, Colyseus
node --experimental-strip-types --no-warnings bench/transport.mjs
node --experimental-strip-types --no-warnings bench/middleware.mjs
node --experimental-strip-types --no-warnings bench/query.mjs
node bench/node/generated-size.mjs # sizes; needs the zstd CLI
node bench/size.mjs

--repeat=n sets the runs per runtime, --runtimes=node,chromium picks runtimes, and --out=dir writes the results elsewhere. node bench/compare.mjs old.json new.json compares two runs of a suite.