Skip to content

Payload types

Measured with Knitting 0.1.77.

Each call sends a value to a worker that returns it unchanged. The measured time covers encoding, transport and decoding in both directions. All binary values contain 1 KiB.

  • Batching improves throughput. With 100 primitive calls in flight, Node.js and Bun process 2–6× as many calls per second as with one at a time.
  • Deno’s single calls have higher overhead. Its primitives take roughly ten times as long as on Node.js and Bun. With 100 calls in flight, their cost per call is close to Node.js.
  • Errors cost the most. Error is the slowest type on every runtime at both batch sizes.
  • Binary views vary by runtime. With 100 calls in flight, Uint8Array takes about half the time of Float64Array on Node.js; Bun favors Float64Array.

These differences exceeded the spread between runs.

Knitting
0.1.77
Machine
Intel Xeon Platinum 8168 @ 2.70GHz, 8 threads
Runtimes
Node.js 24.19.0, Deno 2.7.4, Bun 1.4.0
Source runs
12 September 2026, 3 runs
Source details

1789245992919, 1789246042357, 1789246092383

Bench commit bcd182e with uncommitted changes. Original run versions: 0.1.70.

The charts show median time per call and the range across runs. The second tab divides batch time by 100 to compare throughput; it does not show the latency of an individual call.

  • 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

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
npm install knitting@0.1.77
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...>