Skip to content

Payload types

Each call sends one value to a worker whose task is (v) => v, then waits for the value to come back. The worker does no work, so the time is what Knitting spends moving that value in both directions. Every binary type carries the same 1 KiB, so those rows compare directly.

Knitting
0.1.70
Machine
Intel Xeon Platinum 8168 @ 2.70GHz, 8 threads
Runtimes
Node.js 24.19.0, Deno 2.7.4, Bun 1.4.0
Measured
12 September 2026, 3 runs
Source
1789245992919, 1789246042357, 1789246092383 at bench commit bcd182e with uncommitted changes

The chart and table on this page are generated from those runs when the site is built. With 100 calls in flight, a row shows the time for the whole batch divided by 100.

  • Node.js 24.19.0
  • Deno 2.7.4
  • Bun 1.4.0
  1. boolean
  2. undefined
  3. null
  4. number
  5. bigint (small)
  6. string (10 B)
  7. Date
  8. Promise<number>
  9. Symbol.for
  10. string (1 KiB)
  11. Uint8Array (1 KiB)
  12. Buffer (1 KiB)
  13. BigUint64Array (1 KiB)
  14. ArrayBuffer (1 KiB)
  15. Float64Array (1 KiB)
  16. BigInt64Array (1 KiB)
  17. bigint (2^70)
  18. DataView (1 KiB)
  19. Int32Array (1 KiB)
  20. json object
  21. json array (11)
  22. Error
Microseconds per call, one call at a time, on a log scale. Each mark is the median of 3 runs, and the line through it spans the fastest and slowest run. Rows are sorted by cost.
Show the numbers
Payload Node.jsDenoBun
boolean 2.29 µs 2.08 µs to 3.49 µs 30.8 µs 20.0 µs to 34.1 µs 2.22 µs 1.52 µs to 2.44 µs
undefined 2.81 µs 2.01 µs to 2.95 µs 28.5 µs 5.18 µs to 32.7 µs 1.49 µs 1.32 µs to 5.20 µs
null 2.96 µs 1.56 µs to 3.84 µs 33.5 µs 33.4 µs to 34.8 µs 1.53 µs 1.42 µs to 1.76 µs
number 3.05 µs 1.82 µs to 3.07 µs 25.1 µs 8.56 µs to 43.9 µs 1.71 µs 1.59 µs to 1.74 µs
bigint (small) 3.31 µs 2.82 µs to 3.44 µs 33.7 µs 21.3 µs to 35.6 µs 3.23 µs 2.57 µs to 3.28 µs
string (10 B) 4.73 µs 4.42 µs to 6.32 µs 24.7 µs 22.3 µs to 36.3 µs 3.94 µs 3.69 µs to 4.40 µs
Date 4.67 µs 4.00 µs to 5.73 µs 33.7 µs 28.3 µs to 37.2 µs 4.90 µs 4.04 µs to 4.96 µs
Promise<number> 4.17 µs 3.72 µs to 5.57 µs 32.3 µs 27.8 µs to 34.9 µs 5.57 µs 5.47 µs to 5.71 µs
Symbol.for 6.43 µs 4.86 µs to 6.49 µs 32.6 µs 28.6 µs to 34.2 µs 4.15 µs 3.70 µs to 4.56 µs
string (1 KiB) 8.14 µs 7.14 µs to 10.1 µs 36.3 µs 35.7 µs to 36.9 µs 7.97 µs 7.42 µs to 13.0 µs
Uint8Array (1 KiB) 9.17 µs 6.44 µs to 14.1 µs 38.6 µs 36.6 µs to 40.2 µs 8.51 µs 7.94 µs to 12.0 µs
Buffer (1 KiB) 12.1 µs 9.76 µs to 17.7 µs 39.5 µs 36.2 µs to 41.7 µs 10.3 µs 9.77 µs to 11.1 µs
BigUint64Array (1 KiB) 8.79 µs 7.65 µs to 9.07 µs 40.5 µs 38.6 µs to 42.6 µs 12.2 µs 11.0 µs to 12.8 µs
ArrayBuffer (1 KiB) 13.2 µs 11.4 µs to 14.9 µs 43.1 µs 41.6 µs to 43.5 µs 14.9 µs 13.3 µs to 20.7 µs
Float64Array (1 KiB) 15.2 µs 14.2 µs to 45.7 µs 36.2 µs 34.3 µs to 37.6 µs 9.99 µs 6.09 µs to 18.6 µs
BigInt64Array (1 KiB) 8.60 µs 6.02 µs to 8.87 µs 36.2 µs 36.2 µs to 38.9 µs 16.6 µs 15.2 µs to 17.4 µs
bigint (2^70) 11.1 µs 8.77 µs to 12.5 µs 41.0 µs 40.5 µs to 62.8 µs 16.7 µs 16.2 µs to 18.2 µs
DataView (1 KiB) 8.37 µs 8.16 µs to 9.04 µs 39.2 µs 39.1 µs to 40.5 µs 18.9 µs 8.40 µs to 21.0 µs
Int32Array (1 KiB) 8.32 µs 5.43 µs to 9.88 µs 39.4 µs 38.0 µs to 40.3 µs 23.1 µs 19.3 µs to 30.2 µs
json object 31.0 µs 23.2 µs to 36.1 µs 45.8 µs 43.6 µs to 46.7 µs 16.5 µs 11.3 µs to 17.8 µs
json array (11) 46.0 µs 29.7 µs to 56.5 µs 50.4 µs 49.3 µs to 52.7 µs 24.2 µs 22.1 µs to 27.6 µs
Error 72.9 µs 69.6 µs to 76.6 µs 98.0 µs 91.5 µs to 99.9 µs 51.7 µs 48.1 µs to 53.1 µs

Each point compares medians, and each difference is larger than the spread between runs. Smaller differences did not repeat, so they are left out.

  • Batching matters more than the type. On Node.js and Bun, sending a number, boolean, null, undefined or small bigint costs two to six times less per call with 100 calls in flight than one call at a time.
  • On Deno, a single call is expensive whatever it carries. One call at a time, Deno’s primitives cost almost as much as its 1 KiB binary types, and roughly ten times what Node.js and Bun take for the same values. Most of that cost is per call rather than per byte: with 100 calls in flight, Deno’s primitives cost about the same as Node’s.
  • Error is the most expensive type everywhere. It is the slowest row on every runtime at both batch sizes, well clear of the next one.
  • The cheapest 1 KiB view depends on the runtime. With 100 calls in flight, Uint8Array costs about half as much as Float64Array on Node.js, and on Bun it is the other way round.

The suite lives in knitting-vs-tokio-bench:

Terminal window
git clone https://github.com/mimiMonads/knitting-vs-tokio-bench
cd knitting-vs-tokio-bench
npm install
node scripts/bench.mjs types
node scripts/tables.mjs

Each run writes a directory under results/. To update this page, commit the new runs in the bench repo, then copy them into the docs:

Terminal window
npm run bench:sync -- ../knitting-vs-tokio-bench <runId...>