Performance
Benchmarks — measured and public
Thirteen compute kernels in F# (compiled to WasmGC by fsharp-wasm) and in plain JavaScript, on Node, Deno, Bun and Chromium; the size of every compiled module; and the time to download and compile it on Wi-Fi, 4G and 3G.
What is measured
One machine (a 4-vCPU virtual machine), recorded as it came out; the raw reports are published next to the tables. How to read them: docs/benchmarks.md in fsharp-wasm-runtime.
Speed
On V8 (Node, Deno, Chromium) the F# module is faster in 9–11 of 13 kernels; the geometric mean against JavaScript is 1.45–1.58× without the list pipeline the compiler fuses into one loop. On JavaScriptCore (Bun) it is 1.03×. Part of the V8 result is V8 inlining small functions: with its inliner off the mean drops from 1.45× to 1.27×.
Binary size
Modules are 6–172 KB raw and 2–49 KB with brotli (29–39 % of the raw size); they are published without their name section, which was a third to a half of a small module. Only the two graphics modules, the widget editor and the scene gallery, are larger than 12 KB compressed. For the small demos the JavaScript glue and the stylesheet weigh about as much as the module.
Network
Latency, not size, dominates the small modules: a 6.5 KB module takes 0.34 s on 3G, 0.30 s of it the round trip. The widget editor needs 0.97 s on 3G with gzip (2.1 s without). GitHub Pages sends gzip, not brotli. Emulated network; a button measures your own line.
Speed
The thirteen kernels
Each is written twice, in F# and in plain JavaScript, with the same algorithm and the same order of operations; before any time counts, both sides must return the same checksum.
| Kernel | What it stresses | Standard size |
|---|---|---|
| Mandelbrot | double arithmetic in a branchy inner loop | 700² points |
| N-body | double arithmetic on small arrays, sqrt | 1 000 000 steps |
| Spectral norm | nested loops, int→double, division | n = 700 |
| Matrix product | dense array reads and writes | 400³ |
| Sieve | byte-array writes with a stride | 5 000 000 |
| Fannkuch-redux | int array shuffling in tight loops | n = 9 |
| CRC-32 | 32-bit integer operations, table lookups | 16 000 000 bytes |
| Collatz | 64-bit integers (int64 in F#, doubles in JavaScript) | starts < 300 000 |
| Fibonacci | function calls, recursion | fib 35 |
| Binary trees | allocation and garbage collection | depth 15 |
| Word count | string building, hashing, comparison | 1 200 000 words |
| Quicksort | int array partitioning, recursion | 1 500 000 ints |
| List pipeline † | map / filter / fold over a collection | 3 000 000 elements |
† The compiler fuses the three steps into one loop; this row measures that optimisation and is left out of the second geometric mean.
Speed
F# against JavaScript, kernel by kernel
How many times faster the F# module is than the JavaScript: above 1 the module wins and the number is coloured. The median of the recorded runs, and in brackets the range of the runs; ⚠ marks a kernel whose samples spread over more than a quarter of their median.
| Kernel | Node 24 3 runs | Node 24, V8’s Wasm inlining off | Deno 2 | Bun 1 | Chromium 153 |
|---|---|---|---|---|---|
| Mandelbrot | 1.00 (0.98–1.00) | 1.04 | 0.91 | 1.01 | 0.90 |
| N-body | 1.67 (1.66–1.71) | 1.83 | 1.18 | 1.01 | 1.79 |
| Spectral norm | 2.38 (2.34–2.44) | 1.24 ⚠ | 6.69 ⚠ | 1.13 ⚠ | 2.54 ⚠ |
| Matrix product | 1.57 (1.53–1.71) | 1.64 ⚠ | 1.39 | 1.03 | 1.53 |
| Sieve | 1.06 (1.04–1.08) ⚠ | 1.05 | 1.10 | 1.06 | 1.19 |
| Fannkuch-redux | 1.29 (1.27–1.32) | 1.30 | 1.22 | 0.93 | 1.40 |
| CRC-32 | 0.90 (0.89–0.91) | 0.93 | 0.98 | 1.02 | 0.88 |
| Collatz | 5.05 (4.17–5.48) ⚠ | 4.76 | 4.42 | 1.80 | 5.64 ⚠ |
| Fibonacci | 2.29 (2.25–2.34) | 1.23 | 3.40 ⚠ | 1.22 | 3.13 |
| Binary trees | 0.84 (0.77–0.85) | 0.72 | 0.86 | 0.56 | 1.20 |
| Word count | 0.82 (0.81–0.94) | 0.69 | 0.94 | 0.88 | 1.01 |
| Quicksort | 1.25 (1.23–1.40) | 1.20 | 1.24 | 1.05 | 1.25 |
| List pipeline † | 78 (73–83) | 78 | 72 | 12 | 57 |
| geometric mean | 1.97 (1.93–1.97) | 1.74 | 2.09 | 1.24 | 2.08 |
| geometric mean without † | 1.45 (1.42–1.45) | 1.27 | 1.55 | 1.03 | 1.58 |
Recorded 2026-11-14, standard profile, module of 17706 bytes (sha256 9c294196595e6395…), Intel(R) Xeon(R) Processor @ 2.10GHz × 4. † the list pipeline that the compiler fuses into one loop, which JavaScript does not; the geometric mean is given with and without it. The raw reports: site/benchmarks.
Size
What a module weighs
Raw, gzip and brotli size of every module (2026-11-22). Same-origin requests only; sizes as the server holds them, gzip level 9, brotli quality 11.
| Module | raw | gzip | brotli | brotli ÷ raw |
|---|---|---|---|---|
| WidgetEditor.wasm widget-editor | 172 KB | 62 KB | 49 KB | 29 % |
| SceneGallery.wasm graphics-gallery | 104 KB | 42 KB | 34 KB | 33 % |
| Dashboard.wasm full-dashboard | 26 KB | 9.6 KB | 7.6 KB | 29 % |
| IndexedDbCrud.wasm indexeddb-crud | 18 KB | 7.1 KB | 6.0 KB | 34 % |
| Todo.wasm todo | 16 KB | 6.5 KB | 5.5 KB | 35 % |
| WorkerActor.wasm worker-actor | 14 KB | 6.1 KB | 5.2 KB | 36 % |
| RealtimePubSub.wasm realtime-pubsub | 14 KB | 5.9 KB | 5.0 KB | 37 % |
| WebGpuBasic.wasm webgpu-basic | 13 KB | 5.4 KB | 4.7 KB | 37 % |
| Counter.wasm counter | 13 KB | 5.3 KB | 4.5 KB | 36 % |
| Bench.wasm bench | 10 KB | 4.5 KB | 4.0 KB | 39 % |
| MyCounter.wasm web-component | 6.8 KB | 2.8 KB | 2.5 KB | 37 % |
| Mandelbrot.wasm canvas-mandelbrot | 6.4 KB | 2.6 KB | 2.3 KB | 36 % |
What a page loads
| Page | requests | raw | gzip | brotli | the largest two |
|---|---|---|---|---|---|
| (landing page) | 37 | 344 KB | 116 KB | 97 KB | SceneGallery.wasm 104 KB, pico.min.css 80 KB |
| bench | 11 | 63 KB | 26 KB | 23 KB | kernels.js 11 KB, bench 10 KB |
| canvas-mandelbrot | 6 | 26 KB | 11 KB | 10 KB | theme.css 7.8 KB, Mandelbrot.wasm 6.4 KB |
| counter | 25 | 73 KB | 30 KB | 26 KB | Counter.wasm 13 KB, gfx.js 10 KB |
| full-dashboard | 25 | 87 KB | 34 KB | 29 KB | Dashboard.wasm 26 KB, gfx.js 10 KB |
| graphics-gallery | 24 | 166 KB | 67 KB | 56 KB | SceneGallery.wasm 104 KB, gfx.js 10 KB |
| indexeddb-crud | 25 | 78 KB | 32 KB | 27 KB | IndexedDbCrud.wasm 18 KB, gfx.js 10 KB |
| realtime-pubsub | 25 | 74 KB | 31 KB | 26 KB | RealtimePubSub.wasm 14 KB, gfx.js 10 KB |
| todo | 25 | 76 KB | 31 KB | 27 KB | Todo.wasm 16 KB, gfx.js 10 KB |
| web-component | 24 | 66 KB | 27 KB | 23 KB | gfx.js 10 KB, theme.css 7.8 KB |
| webgpu-basic | 24 | 72 KB | 30 KB | 25 KB | WebGpuBasic.wasm 13 KB, gfx.js 10 KB |
| widget-editor | 24 | 232 KB | 86 KB | 70 KB | WidgetEditor.wasm 172 KB, gfx.js 10 KB |
| worker-actor | 26 | 75 KB | 31 KB | 27 KB | WorkerActor.wasm 14 KB, gfx.js 10 KB |
Network
Download plus compile, on five networks
Every module on an emulated network (2026-11-22), three runs; the time to download it and to compile it. Latency, not size, dominates the small modules.
gzip (what GitHub Pages sends)
| Module | on the wire | Localhost no limit | Wi-Fi 30 Mbps, 20 ms | 4G 9 Mbps, 85 ms | Slow 4G 1.6 Mbps, 150 ms | 3G 0.78 Mbps, 300 ms |
|---|---|---|---|---|---|---|
| WidgetEditor.wasm widget-editor | 62 KB | 7 ms | 46 ms | 153 ms | 477 ms | 967 ms |
| SceneGallery.wasm graphics-gallery | 42 KB | 6 ms | 40 ms | 131 ms | 374 ms | 752 ms |
| Dashboard.wasm full-dashboard | 9.6 KB | 5 ms | 28 ms | 100 ms | 208 ms | 413 ms |
| IndexedDbCrud.wasm indexeddb-crud | 7.1 KB | 4 ms | 26 ms | 98 ms | 186 ms | 382 ms |
| Todo.wasm todo | 6.5 KB | 4 ms | 27 ms | 97 ms | 193 ms | 367 ms |
| WorkerActor.wasm worker-actor | 6.1 KB | 4 ms | 27 ms | 98 ms | 187 ms | 372 ms |
| RealtimePubSub.wasm realtime-pubsub | 5.9 KB | 4 ms | 27 ms | 97 ms | 187 ms | 368 ms |
| WebGpuBasic.wasm webgpu-basic | 5.4 KB | 5 ms | 26 ms | 97 ms | 180 ms | 356 ms |
| Counter.wasm counter | 5.3 KB | 4 ms | 26 ms | 95 ms | 185 ms | 353 ms |
| Bench.wasm bench | 4.5 KB | 4 ms | 26 ms | 96 ms | 185 ms | 352 ms |
| MyCounter.wasm web-component | 2.8 KB | 4 ms | 26 ms | 93 ms | 178 ms | 337 ms |
| Mandelbrot.wasm canvas-mandelbrot | 2.6 KB | 4 ms | 26 ms | 93 ms | 170 ms | 337 ms |
brotli
| Module | on the wire | Localhost no limit | Wi-Fi 30 Mbps, 20 ms | 4G 9 Mbps, 85 ms | Slow 4G 1.6 Mbps, 150 ms | 3G 0.78 Mbps, 300 ms |
|---|---|---|---|---|---|---|
| WidgetEditor.wasm widget-editor | 49 KB | 7 ms | 46 ms | 138 ms | 410 ms | 828 ms |
| SceneGallery.wasm graphics-gallery | 34 KB | 8 ms | 38 ms | 127 ms | 334 ms | 675 ms |
| Dashboard.wasm full-dashboard | 7.6 KB | 7 ms | 28 ms | 98 ms | 201 ms | 383 ms |
| IndexedDbCrud.wasm indexeddb-crud | 6.0 KB | 5 ms | 27 ms | 98 ms | 193 ms | 383 ms |
| Todo.wasm todo | 5.5 KB | 4 ms | 27 ms | 97 ms | 179 ms | 352 ms |
| WorkerActor.wasm worker-actor | 5.2 KB | 3 ms | 26 ms | 97 ms | 179 ms | 353 ms |
| RealtimePubSub.wasm realtime-pubsub | 5.0 KB | 5 ms | 26 ms | 96 ms | 179 ms | 353 ms |
| WebGpuBasic.wasm webgpu-basic | 4.7 KB | 4 ms | 27 ms | 96 ms | 185 ms | 367 ms |
| Counter.wasm counter | 4.5 KB | 5 ms | 26 ms | 96 ms | 180 ms | 368 ms |
| Bench.wasm bench | 4.0 KB | 5 ms | 26 ms | 94 ms | 175 ms | 351 ms |
| MyCounter.wasm web-component | 2.5 KB | 4 ms | 28 ms | 95 ms | 164 ms | 335 ms |
| Mandelbrot.wasm canvas-mandelbrot | 2.3 KB | 4 ms | 26 ms | 93 ms | 170 ms | 322 ms |
no compression
| Module | on the wire | Localhost no limit | Wi-Fi 30 Mbps, 20 ms | 4G 9 Mbps, 85 ms | Slow 4G 1.6 Mbps, 150 ms | 3G 0.78 Mbps, 300 ms |
|---|---|---|---|---|---|---|
| WidgetEditor.wasm widget-editor | 172 KB | 6 ms | 77 ms | 251 ms | 1040 ms | 2120 ms |
| SceneGallery.wasm graphics-gallery | 104 KB | 5 ms | 58 ms | 188 ms | 696 ms | 1413 ms |
| Dashboard.wasm full-dashboard | 26 KB | 4 ms | 33 ms | 117 ms | 284 ms | 582 ms |
| IndexedDbCrud.wasm indexeddb-crud | 18 KB | 4 ms | 32 ms | 109 ms | 253 ms | 492 ms |
| Todo.wasm todo | 16 KB | 4 ms | 29 ms | 105 ms | 231 ms | 475 ms |
| WorkerActor.wasm worker-actor | 14 KB | 4 ms | 30 ms | 104 ms | 231 ms | 445 ms |
| RealtimePubSub.wasm realtime-pubsub | 14 KB | 4 ms | 30 ms | 104 ms | 224 ms | 445 ms |
| WebGpuBasic.wasm webgpu-basic | 13 KB | 4 ms | 30 ms | 103 ms | 223 ms | 430 ms |
| Counter.wasm counter | 13 KB | 4 ms | 29 ms | 103 ms | 221 ms | 430 ms |
| Bench.wasm bench | 10 KB | 5 ms | 27 ms | 101 ms | 209 ms | 428 ms |
| MyCounter.wasm web-component | 6.8 KB | 4 ms | 28 ms | 97 ms | 186 ms | 382 ms |
| Mandelbrot.wasm canvas-mandelbrot | 6.4 KB | 5 ms | 27 ms | 97 ms | 186 ms | 368 ms |
The real host
https://fsharp-wasm.github.io/fsharp-wasm-runtime, asked with curl from one cloud VM (2026-11-14): the median of three requests after a warm-up. GitHub Pages sends gzip and no brotli: asked for brotli it answers with the file as it is.
| Module | raw | sent as gzip | request: none / gzip / brotli |
|---|---|---|---|
| WidgetEditor.wasm widget-editor | 149 KB | 55 KB | 125 / 119 / 122 ms |
| SceneGallery.wasm graphics-gallery | 137 KB | 54 KB | 134 / 114 / 129 ms |
| Dashboard.wasm full-dashboard | 46 KB | 15 KB | 118 / 108 / 120 ms |
| IndexedDbCrud.wasm indexeddb-crud | 31 KB | 12 KB | 126 / 105 / 108 ms |
| Todo.wasm todo | 28 KB | 11 KB | 105 / 121 / 105 ms |
| WorkerActor.wasm worker-actor | 26 KB | 9.9 KB | 106 / 105 / 108 ms |
| RealtimePubSub.wasm realtime-pubsub | 24 KB | 9.6 KB | 126 / 113 / 109 ms |
| Counter.wasm counter | 22 KB | 8.7 KB | 120 / 109 / 112 ms |
| WebGpuBasic.wasm webgpu-basic | 22 KB | 8.8 KB | 106 / 103 / 105 ms |
| Bench.wasm bench | 17 KB | 7.2 KB | 200 / 123 / 120 ms |
| MyCounter.wasm web-component | 13 KB | 5.2 KB | 105 / 101 / 111 ms |
| Mandelbrot.wasm canvas-mandelbrot | 12 KB | 4.8 KB | 114 / 122 / 114 ms |
Your own line is another matter: a button on the runtime's page downloads and compiles every module from this host and shows what it took.
Everything we measure
Six benchmark suites
Where each lives, what it records, and the command that reproduces it.
Speed — F# against JavaScript
The thirteen kernels above, each written twice with the same algorithm, on Node, Deno, Bun and Chromium; cold call, warm-up, alternating samples, median and spread, results compared bit for bit.
Run:
node demos/bench/run.mjs --profile standardOpen · fsharp-wasm-runtime
Speed — in your browser
The same harness as a page: choose the kernels, see the chart and the table, download the JSON.
Open · fsharp-wasm-runtime
Binary size
Raw, gzip and brotli size of every module and of what each page loads: 6–172 KB raw, 2–49 KB with brotli.
Open · fsharp-wasm-runtime
Network — download and compile
Every module on five emulated networks (localhost, Wi-Fi, 4G, slow 4G, 3G) with three encodings; the benchmark page can also measure your own line.
Run:
E2E_ROOT=site node tests/e2e/network.mjsOpen · fsharp-wasm-runtime
Compiler optimisations, measured
A/B runs with V8’s own inliner off, with the compiler’s optional inliner, and with packed bool[] / byte[] arrays; the reports are published as JSON.
Open · fsharp-wasm-runtime
.NET against WebAssembly
The same F# functions on .NET (Release) and as WebAssembly on Node: the checksums must be identical, the times go to the CI job summary.
Run:
bash tests/Bench/run.shOpen · fsharp-wasm
Not measured yet
Planned, not done: we publish what exists.
Startup of whole applications
Only module size, download and compile time are recorded, not the time to a first interaction of a page.
Memory and GC
No peak heap or pause measurements yet; the binary-trees kernel shows throughput only.
Compile time and other engines
End-to-end compile time of the compiler, and Firefox and Safari, are not measured.
Comparison targets
Hand-written JavaScript is measured today. The others are planned: the same programs in comparable technologies.
Fable → JavaScript
The same F# code compiled by Fable to JavaScript — the closest apples-to-apples comparison for F# semantics.
Blazor WebAssembly
Microsoft's .NET-on-Wasm stack — a different approach with a much larger runtime footprint.
Hand-written JavaScript
Idiomatic JS implementations of the same algorithms — the baseline that Wasm needs to beat.
Kotlin/Wasm
Kotlin's WasmGC backend — another typed functional language targeting the same runtime.
Want to help shape the benchmarks?
We welcome benchmark contributions, methodology proposals, and real-world workloads from the community. If you have a use-case you would like us to measure, open an issue.