Performance · backend
Backend benchmarks — one module on the edge's engines
The Ghost Todo, written in F# and compiled to WebAssembly GC, against the same API in hand-written JavaScript and in Hono: what one request costs on Node, Bun and workerd, what changed in a single day, and what these numbers do not say. Measured 2026-11-22, in one process, on one machine; nothing here is a deployment.
What is measured
A request handled by the application, fetch(request) → response, without a network and without a platform in front. Before anything is timed, 18 requests go to all three implementations and the answers must be identical.
The same API three times
State, add, toggle, delete and patches since a version. The F# module runs on the host core of fsharp-wasm-edge; the JavaScript and the Hono version share one logic file that does the same as the F# model, with the same GGBP patches and the same persistence.
Three engines
Node 22.23.4, Bun 1.4.4 and workerd through Miniflare, the engine of Cloudflare Workers. workerd freezes the clock inside a Worker while it only computes, so it is timed in batches from outside: its numbers are means, not medians.
Not a deployment
It says what the module and the framework cost per request on each engine. It does not say what a request costs a user of Cloudflare, Vercel or Netlify: that needs deployments, which have not been made yet. The store here is memory, so no storage write is in the numbers.
Median per request
Node
Node 22.23.4 · 2026-11-22 · Intel(R) Xeon(R) Processor @ 2.10GHz × 4
| Scenario | F# → WasmGC | JavaScript | Hono | F# ÷ JavaScript | As a bar |
|---|---|---|---|---|---|
| poll, nothing new | 9.4 µs | 5.4 µs | 5.1 µs | 1.7× | 1.7× as a bar, capped at 25× |
| state, 100 todos | 56.1 µs | 14.5 µs | 14.1 µs | 3.9× | 3.9× as a bar, capped at 25× |
| state, 5 000 todos | 7.47 ms | 593 µs | 596 µs | 12.6× | 12.6× as a bar, capped at 25× |
| toggle, 100 todos | 17.9 µs | 8.6 µs | 9.3 µs | 2.1× | 2.1× as a bar, capped at 25× |
| toggle, 5 000 todos | 49.6 µs | 31.0 µs | 32.2 µs | 1.6× | 1.6× as a bar, capped at 25× |
| add + remove, 100 todos | 30.9 µs | 14.7 µs | 14.0 µs | 2.1× | 2.1× as a bar, capped at 25× |
The 99th percentile of a toggle in 5 000 todos is 7.01 ms: every 64th change the module writes a checkpoint after its response, and in this in-process loop the next request waits behind it. The median does not show it.
Median per request
Bun
Bun 1.4.4 · 2026-11-22 · Intel(R) Xeon(R) Processor @ 2.10GHz × 4
| Scenario | F# → WasmGC | JavaScript | Hono | F# ÷ JavaScript | As a bar |
|---|---|---|---|---|---|
| poll, nothing new | 7.4 µs | 2.0 µs | 1.7 µs | 3.6× | 3.6× as a bar, capped at 25× |
| state, 100 todos | 85.9 µs | 5.4 µs | 5.4 µs | 16.1× | 16.1× as a bar, capped at 25× |
| state, 5 000 todos | 6.87 ms | 313 µs | 312 µs | 21.9× | 21.9× as a bar, capped at 25× |
| toggle, 100 todos | 17.0 µs | 6.7 µs | 7.2 µs | 2.5× | 2.5× as a bar, capped at 25× |
| toggle, 5 000 todos | 95.1 µs | 32.7 µs | 34.1 µs | 2.9× | 2.9× as a bar, capped at 25× |
| add + remove, 100 todos | 20.2 µs | 9.1 µs | 8.1 µs | 2.2× | 2.2× as a bar, capped at 25× |
The 99th percentile of a toggle in 5 000 todos is 8.26 ms: every 64th change the module writes a checkpoint after its response, and in this in-process loop the next request waits behind it. The median does not show it.
Mean per request
workerd (the engine of Cloudflare Workers, through Miniflare)
workerd · 2026-11-22 · Intel(R) Xeon(R) Processor @ 2.10GHz × 4
| Scenario | F# → WasmGC | JavaScript | Hono | F# ÷ JavaScript | As a bar |
|---|---|---|---|---|---|
| poll, nothing new | 24.9 µs | 13.5 µs | 13.3 µs | 1.8× | 1.8× as a bar, capped at 25× |
| state, 100 todos | 74.6 µs | 17.9 µs | 16.6 µs | 4.2× | 4.2× as a bar, capped at 25× |
| state, 5 000 todos | 3.47 ms | 515 µs | 612 µs | 6.7× | 6.7× as a bar, capped at 25× |
| toggle, 100 todos | 36.9 µs | 15.6 µs | 27.9 µs | 2.4× | 2.4× as a bar, capped at 25× |
| toggle, 5 000 todos | 117 µs | 113 µs | 86.1 µs | 1.0× | 1.0× as a bar, capped at 25× |
| add + remove, 100 todos | 63.1 µs | 27.0 µs | 33.2 µs | 2.3× | 2.3× as a bar, capped at 25× |
Three changes, one day
From one call per character to one patch per change
The same module, rebuilt twice. The first change was found by a CPU profile (42.5 % of a request was JavaScript-to-WebAssembly calls, one per character); the second by asking what a toggle writes: the whole list.
| Engine | Scenario | one call per character | a whole string through the module’s memory | a mutation persists its patch, not the state |
|---|---|---|---|---|
| Node | toggle, 5 000 todos | 20.53 ms | 9.78 ms | 49.6 µs |
| Node | state, 5 000 todos | 20.37 ms | 6.81 ms | 7.47 ms |
| Node | toggle, 100 todos | 614 µs | 175 µs | 17.9 µs |
| Bun | toggle, 5 000 todos | 40.33 ms | 8.07 ms | 95.1 µs |
| Bun | state, 5 000 todos | 43.19 ms | 7.11 ms | 6.87 ms |
| Bun | toggle, 100 todos | 1.62 ms | 270 µs | 17.0 µs |
| workerd (mean) | toggle, 5 000 todos | 11.25 ms | 4.62 ms | 117 µs |
| workerd (mean) | state, 5 000 todos | 8.54 ms | 3.62 ms | 3.47 ms |
| workerd (mean) | toggle, 100 todos | 557 µs | 195 µs | 36.9 µs |
The lowest of each row is bold. The state of 5 000 todos is not what the third change touches: its slightly higher time on Node (6.81 to 7.47 ms) was not examined and is within what two runs of this machine differ by. In the first two builds the JavaScript of the benchmark persisted the whole list too, as the module did; in the third both persist the patch of a change, so the ratios above compare the module and the language, not two ways of persisting. How and why: docs/persistence.md.
Shipped code
What a deployment would carry
Minified, and gzip -9 of that (2026-11-22). The module grew by 10 KB when it learned to replay its log: the decoder and the transition the clients use are in it now.
| Deployed code | Minified | gzip |
|---|---|---|
| F# → WasmGC: the module | 58.4 KB | 23.5 KB |
| F# → WasmGC: the module and the host core | 63.0 KB | 25.7 KB |
| JavaScript (hand-written) | 7.0 KB | 2.8 KB |
| JavaScript (Hono) | 26.6 KB | 10.7 KB |
Read it this way
What these numbers leave out
One machine, one day
A shared 4-core Xeon, 2026-11-22. Numbers vary by some percent from run to run and by a lot between machines; compare the ratios, not the absolute times.
Still far behind on a long answer
The state of 5 000 todos is 218 000 characters of JSON, and the module needs 6.7 to 22 times what the JavaScript needs for it: the JSON writer of the compiled code builds a tree first. That is the next thing to improve, in the compiler.
What the module buys
Not speed or size: one language and the same code on the server and in the client (the model and the shadow of the Ghost Todo run in the module and in the canvas client), and a type checker for both.