Skip to content

Performance

Here are five measured performance results:

  1. It puts a second core to work: /ping p99 fell by 86% at similar CPU usage in the Hono test.
  2. A call costs a fraction of postMessage, with lower round-trip overhead on all three runtimes tested.
  3. CPU-heavy work spreads across threads, 3.5× faster with four extra threads on Node.js.
  4. Binary round trips are comparable to Tokio in the 32–512 KiB range tested.
  5. A typesetting workload scales across cores: warm full-document runs were 1.86× faster on Node and 1.77× on Bun with four workers.

The charted comparisons below show elapsed time or CPU usage; each result also links to the numbers behind it. These are separate runs, with their own hardware and Knitting versions.

Measured on 24–25 August 2026 with Bun 1.4.0 and Knitting commit 6c0e56d, on an Intel Xeon Platinum 8168 server with 16 dedicated cores, running Ubuntu 24.04. A separate machine generated the load. The report has the setup and individual runs.

CPU-heavy JavaScript on one event loop runs on one thread. Moving those routes into a Knitting worker lets another core take part while the main thread keeps serving requests.

The test is a Hono server with three routes. /ssr renders React, /jwt signs a token, and /ping returns a small JSON object. With Knitting, /ssr and /jwt run in one worker and /ping stays on the main thread. Both servers received 2,000 requests per second on each route.

  • Hono only
  • Hono with one Knitting worker

/ping

  • Hono only 16.93 ms
  • One worker 2.31 ms

/ssr

  • Hono only 14.32 ms
  • One worker 8.71 ms

/jwt

  • Hono only 25.18 ms
  • One worker 9.76 ms
p99 response time at 6,000 requests per second in total.

/ping p99 fell by 86%, and /ping never enters the pool. Its requests had been waiting behind renders and signatures on the same thread. /ssr p99 fell by 39% and /jwt by 61%.

Both servers met the offered request rate with 100% success, at approximately the same measured CPU usage:

  • Hono only
  • Hono with one Knitting worker
  • Hono only 1.08 cores
  • One worker 1.10 cores
CPU used by the server process during the same runs.

A repeat of the one-worker run recorded 1.84 cores, also close to the baseline.

Under saturating load, the same change raised total throughput from 8,208 to 18,014 requests per second, and CPU use from 1.19 to 1.79 cores.

Measured in March 2026 with Knitting 0.1.24 on an Apple M3 Ultra: Node.js 24.12.0, Deno 2.6.6 and Bun 1.3.6, on macOS arm64. Bars show average elapsed time from the saved reports.

The task is empty, so the time is what it costs to send a call to a worker and get the reply. Both sides use one worker.

  • postMessage
  • Knitting

Node.js

  • postMessage 11.01 µs
  • Knitting 1.24 µs

Deno

  • postMessage 21.57 µs
  • Knitting 4.99 µs

Bun

  • postMessage 10.86 µs
  • Knitting 2.49 µs
Time for one call and its reply, one call at a time.

One call at a time, Knitting was 8.9× faster on Node.js, 4.3× faster on Deno, and 4.4× faster on Bun in these runs. With 100 calls in flight, it was 5.9× faster on Node.js, 26.0× faster on Deno, and 6.3× faster on Bun. The latter measures batch throughput; dividing batch time by 100 does not give the latency of an individual call.

A payload changes the gap, because both sides then spend time encoding it.

Knitting was ahead on all 20 payload types compared, on every runtime, at both batch sizes.

The smallest advantage was 1.2× for

a large string

on Node.js, with 100 calls in flight.

The saved reports include both the empty-call and payload comparisons for each runtime.

Measured in March 2026 with Knitting 0.1.24 on an Apple M3 Ultra: Node.js 24.12.0, Deno 2.6.6 and Bun 1.3.6, on macOS arm64. Bars show average elapsed time from the saved reports.

The task finds the primes up to 10,000,000 in chunks of 250,000 and returns each chunk’s primes to the main thread. The main thread takes chunks too, so four extra threads means five threads working.

  • Main thread only
  • Main thread plus Knitting workers
  • Main thread only 959 ms
  • 1 extra thread 538 ms · 1.8×
  • 2 extra threads 402 ms · 2.4×
  • 3 extra threads 318 ms · 3.0×
  • 4 extra threads 274 ms · 3.5×
Time to finish the whole range on Node.js.

With four extra threads the run finished 3.5× faster on Node.js, 3.8× on Deno and 3.6× on Bun. Five threads would ideally finish in one fifth of the time. Returning every chunk’s primes to the main thread adds work, so this test measures computation and transport together. The reports include the other worker counts.

A typesetting workload scales across cores

Section titled “A typesetting workload scales across cores”

The open-source knit-tex project typesets a 216-page copy of Pride and Prejudice to PDF. On an Intel Core i5-1135G7 with four physical cores, knitting x4 reduced the median of five warm runs from 427 ms to 229 ms on Node 24.19.0 (1.86×), and from 449 ms to 254 ms on Bun 1.4.0 (1.77×). In both runtimes, pool output hashes matched that runtime’s main-thread output.

The faster runs used more CPU time: 871 ms versus 509 ms on Node, and 1,266 ms versus 607 ms on Bun. The cold full-document run and fresh-process CLI runs were slower with four workers than on the main thread. Pool startup and worker warm-up can outweigh parallel work when the executor is used only once.

The project also tested work stealing with a mixed batch of 2,115 paragraph tasks. At four workers, Node finished 9.7–23.3% sooner across three seeds; Bun’s results ranged from 5.5% slower to 17.5% faster. These runs support a workload-specific benefit, not a general speedup guarantee. The timer-gap measurements in the reports are responsiveness proxies, not request latency. The knit-tex README explains the method and limits; the Node full-document report, Bun full-document report, and mixed-batch reports contain the measurements.

Binary round trips are comparable to Tokio

Section titled “Binary round trips are comparable to Tokio”

Measured in March 2026 with Knitting 0.1.36 on an AMD Ryzen 7 4700U, running Ubuntu 23.10 x86_64. This is a separate run from the M3 Ultra tests above. The Tokio report records the sources and methodology; runtime versions were not recorded in that report.

The Rust program clones a Vec<u8>, sends it to a Tokio task over a channel, and gets a second clone back, with one worker thread. Knitting does the same round trip with a Uint8Array, using preallocated shared memory. This compares the two copying paths, including allocation and worker coordination; it does not measure the speed of copying bytes alone.

  • Tokio (Rust)
  • Knitting
  • Tokio 11.92 ms
  • Knitting on Bun 10.56 ms
  • Knitting on Node.js 10.11 ms
  • Knitting on Deno 11.96 ms
Time for 100 round trips of a 256 KiB payload.

From 32 KiB to 512 KiB, Knitting on Bun and Node.js took 2% to 23% less time than Tokio. On Deno it ranged from 5% less to 10% more.

From 1 KiB to 16 KiB, Tokio was up to 3.2× faster. At 1 MiB it was 1.6–1.9× faster. The Tokio page has every size and explains how copying differs from its separate shared-ownership test.

ReasonWhere the harness is
A second coreThe Hono benchmark report carries the server code in Appendix B and the harness in Appendix C. The server is the Hono example.
Call cost against postMessagebench/latency.ts in mimiMonads/knitting, run with ./run.sh from the repository root.
CPU-heavy work across threadsbench/withload.ts in the same repository, run the same way.
Copy speed against TokioThe latency suite in mimiMonads/knitting-vs-tokio-bench: node scripts/bench.mjs latency.

These results describe the tested configurations. Measure your workload on your target hardware; payload size, runtime and worker count can change the result.

For the full tables and additional measurements, see Benchmark results and methodology. For choosing buffers and worker counts, see Performance tuning.