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.

The benchmark kernels, what each stresses and its standard size
KernelWhat it stressesStandard size
Mandelbrotdouble arithmetic in a branchy inner loop700² points
N-bodydouble arithmetic on small arrays, sqrt1 000 000 steps
Spectral normnested loops, int→double, divisionn = 700
Matrix productdense array reads and writes400³
Sievebyte-array writes with a stride5 000 000
Fannkuch-reduxint array shuffling in tight loopsn = 9
CRC-3232-bit integer operations, table lookups16 000 000 bytes
Collatz64-bit integers (int64 in F#, doubles in JavaScript)starts < 300 000
Fibonaccifunction calls, recursionfib 35
Binary treesallocation and garbage collectiondepth 15
Word countstring building, hashing, comparison1 200 000 words
Quicksortint array partitioning, recursion1 500 000 ints
List pipeline †map / filter / fold over a collection3 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.

Speed of the F# module against JavaScript per kernel and engine: how many times faster the module is
KernelNode 24 3 runsNode 24, V8’s Wasm inlining offDeno 2Bun 1Chromium 153
Mandelbrot1.00 (0.98–1.00)1.040.911.010.90
N-body1.67 (1.66–1.71)1.831.181.011.79
Spectral norm2.38 (2.34–2.44)1.24 ⚠6.69 ⚠1.13 ⚠2.54 ⚠
Matrix product1.57 (1.53–1.71)1.64 ⚠1.391.031.53
Sieve1.06 (1.04–1.08) ⚠1.051.101.061.19
Fannkuch-redux1.29 (1.27–1.32)1.301.220.931.40
CRC-320.90 (0.89–0.91)0.930.981.020.88
Collatz5.05 (4.17–5.48) ⚠4.764.421.805.64 ⚠
Fibonacci2.29 (2.25–2.34)1.233.40 ⚠1.223.13
Binary trees0.84 (0.77–0.85)0.720.860.561.20
Word count0.82 (0.81–0.94)0.690.940.881.01
Quicksort1.25 (1.23–1.40)1.201.241.051.25
List pipeline †78 (73–83)78721257
geometric mean1.97 (1.93–1.97)1.742.091.242.08
geometric mean without †1.45 (1.42–1.45)1.271.551.031.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.

Run the thirteen kernels in your browser

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.

Size of every compiled module, raw, with gzip and with brotli
Modulerawgzipbrotlibrotli ÷ raw
WidgetEditor.wasm widget-editor172 KB62 KB49 KB29 %
SceneGallery.wasm graphics-gallery104 KB42 KB34 KB33 %
Dashboard.wasm full-dashboard26 KB9.6 KB7.6 KB29 %
IndexedDbCrud.wasm indexeddb-crud18 KB7.1 KB6.0 KB34 %
Todo.wasm todo16 KB6.5 KB5.5 KB35 %
WorkerActor.wasm worker-actor14 KB6.1 KB5.2 KB36 %
RealtimePubSub.wasm realtime-pubsub14 KB5.9 KB5.0 KB37 %
WebGpuBasic.wasm webgpu-basic13 KB5.4 KB4.7 KB37 %
Counter.wasm counter13 KB5.3 KB4.5 KB36 %
Bench.wasm bench10 KB4.5 KB4.0 KB39 %
MyCounter.wasm web-component6.8 KB2.8 KB2.5 KB37 %
Mandelbrot.wasm canvas-mandelbrot6.4 KB2.6 KB2.3 KB36 %

What a page loads

What each page of the showcase loads: requests and bytes
Pagerequestsrawgzipbrotlithe largest two
(landing page)37344 KB116 KB97 KBSceneGallery.wasm 104 KB, pico.min.css 80 KB
bench1163 KB26 KB23 KBkernels.js 11 KB, bench 10 KB
canvas-mandelbrot626 KB11 KB10 KBtheme.css 7.8 KB, Mandelbrot.wasm 6.4 KB
counter2573 KB30 KB26 KBCounter.wasm 13 KB, gfx.js 10 KB
full-dashboard2587 KB34 KB29 KBDashboard.wasm 26 KB, gfx.js 10 KB
graphics-gallery24166 KB67 KB56 KBSceneGallery.wasm 104 KB, gfx.js 10 KB
indexeddb-crud2578 KB32 KB27 KBIndexedDbCrud.wasm 18 KB, gfx.js 10 KB
realtime-pubsub2574 KB31 KB26 KBRealtimePubSub.wasm 14 KB, gfx.js 10 KB
todo2576 KB31 KB27 KBTodo.wasm 16 KB, gfx.js 10 KB
web-component2466 KB27 KB23 KBgfx.js 10 KB, theme.css 7.8 KB
webgpu-basic2472 KB30 KB25 KBWebGpuBasic.wasm 13 KB, gfx.js 10 KB
widget-editor24232 KB86 KB70 KBWidgetEditor.wasm 172 KB, gfx.js 10 KB
worker-actor2675 KB31 KB27 KBWorkerActor.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)
Time to download and compile every module, sent with gzip (what GitHub Pages sends)
Moduleon the wireLocalhost no limitWi-Fi 30 Mbps, 20 ms4G 9 Mbps, 85 msSlow 4G 1.6 Mbps, 150 ms3G 0.78 Mbps, 300 ms
WidgetEditor.wasm widget-editor62 KB7 ms46 ms153 ms477 ms967 ms
SceneGallery.wasm graphics-gallery42 KB6 ms40 ms131 ms374 ms752 ms
Dashboard.wasm full-dashboard9.6 KB5 ms28 ms100 ms208 ms413 ms
IndexedDbCrud.wasm indexeddb-crud7.1 KB4 ms26 ms98 ms186 ms382 ms
Todo.wasm todo6.5 KB4 ms27 ms97 ms193 ms367 ms
WorkerActor.wasm worker-actor6.1 KB4 ms27 ms98 ms187 ms372 ms
RealtimePubSub.wasm realtime-pubsub5.9 KB4 ms27 ms97 ms187 ms368 ms
WebGpuBasic.wasm webgpu-basic5.4 KB5 ms26 ms97 ms180 ms356 ms
Counter.wasm counter5.3 KB4 ms26 ms95 ms185 ms353 ms
Bench.wasm bench4.5 KB4 ms26 ms96 ms185 ms352 ms
MyCounter.wasm web-component2.8 KB4 ms26 ms93 ms178 ms337 ms
Mandelbrot.wasm canvas-mandelbrot2.6 KB4 ms26 ms93 ms170 ms337 ms
brotli
Time to download and compile every module, sent with brotli
Moduleon the wireLocalhost no limitWi-Fi 30 Mbps, 20 ms4G 9 Mbps, 85 msSlow 4G 1.6 Mbps, 150 ms3G 0.78 Mbps, 300 ms
WidgetEditor.wasm widget-editor49 KB7 ms46 ms138 ms410 ms828 ms
SceneGallery.wasm graphics-gallery34 KB8 ms38 ms127 ms334 ms675 ms
Dashboard.wasm full-dashboard7.6 KB7 ms28 ms98 ms201 ms383 ms
IndexedDbCrud.wasm indexeddb-crud6.0 KB5 ms27 ms98 ms193 ms383 ms
Todo.wasm todo5.5 KB4 ms27 ms97 ms179 ms352 ms
WorkerActor.wasm worker-actor5.2 KB3 ms26 ms97 ms179 ms353 ms
RealtimePubSub.wasm realtime-pubsub5.0 KB5 ms26 ms96 ms179 ms353 ms
WebGpuBasic.wasm webgpu-basic4.7 KB4 ms27 ms96 ms185 ms367 ms
Counter.wasm counter4.5 KB5 ms26 ms96 ms180 ms368 ms
Bench.wasm bench4.0 KB5 ms26 ms94 ms175 ms351 ms
MyCounter.wasm web-component2.5 KB4 ms28 ms95 ms164 ms335 ms
Mandelbrot.wasm canvas-mandelbrot2.3 KB4 ms26 ms93 ms170 ms322 ms
no compression
Time to download and compile every module, sent with no compression
Moduleon the wireLocalhost no limitWi-Fi 30 Mbps, 20 ms4G 9 Mbps, 85 msSlow 4G 1.6 Mbps, 150 ms3G 0.78 Mbps, 300 ms
WidgetEditor.wasm widget-editor172 KB6 ms77 ms251 ms1040 ms2120 ms
SceneGallery.wasm graphics-gallery104 KB5 ms58 ms188 ms696 ms1413 ms
Dashboard.wasm full-dashboard26 KB4 ms33 ms117 ms284 ms582 ms
IndexedDbCrud.wasm indexeddb-crud18 KB4 ms32 ms109 ms253 ms492 ms
Todo.wasm todo16 KB4 ms29 ms105 ms231 ms475 ms
WorkerActor.wasm worker-actor14 KB4 ms30 ms104 ms231 ms445 ms
RealtimePubSub.wasm realtime-pubsub14 KB4 ms30 ms104 ms224 ms445 ms
WebGpuBasic.wasm webgpu-basic13 KB4 ms30 ms103 ms223 ms430 ms
Counter.wasm counter13 KB4 ms29 ms103 ms221 ms430 ms
Bench.wasm bench10 KB5 ms27 ms101 ms209 ms428 ms
MyCounter.wasm web-component6.8 KB4 ms28 ms97 ms186 ms382 ms
Mandelbrot.wasm canvas-mandelbrot6.4 KB5 ms27 ms97 ms186 ms368 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.

Time to fetch every module from the host: no compression, gzip, brotli
Modulerawsent as gziprequest: none / gzip / brotli
WidgetEditor.wasm widget-editor149 KB55 KB125 / 119 / 122 ms
SceneGallery.wasm graphics-gallery137 KB54 KB134 / 114 / 129 ms
Dashboard.wasm full-dashboard46 KB15 KB118 / 108 / 120 ms
IndexedDbCrud.wasm indexeddb-crud31 KB12 KB126 / 105 / 108 ms
Todo.wasm todo28 KB11 KB105 / 121 / 105 ms
WorkerActor.wasm worker-actor26 KB9.9 KB106 / 105 / 108 ms
RealtimePubSub.wasm realtime-pubsub24 KB9.6 KB126 / 113 / 109 ms
Counter.wasm counter22 KB8.7 KB120 / 109 / 112 ms
WebGpuBasic.wasm webgpu-basic22 KB8.8 KB106 / 103 / 105 ms
Bench.wasm bench17 KB7.2 KB200 / 123 / 120 ms
MyCounter.wasm web-component13 KB5.2 KB105 / 101 / 111 ms
Mandelbrot.wasm canvas-mandelbrot12 KB4.8 KB114 / 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 standard

    Open · 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.mjs

    Open · 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.sh

    Open · 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.