Kernels
How much faster is the F# module?
Ratio of the median times, JavaScript ÷ F# → WasmGC, on a log scale. The bar starts at 1× (same speed).
F# → WasmGC fasterJavaScript faster
| Kernel | JavaScript | F# → WasmGC | Ratio | First call | Result |
|---|---|---|---|---|---|
| press “Run the benchmark” | |||||
How this is measured
- Each kernel runs once cold (the first call: JIT, tier-up) and once discarded, then in alternation — JavaScript first, WasmGC first, … — until the profile's time budget is spent (at least 3 / 7, at most 9 / 31 samples per side). The figure is the median; the grey range is the interquartile range. “First call” is the cold run.
- Sizes are fixed per profile, so runs are comparable; the quick profile uses about a fifth of the work of the standard one.
- The JavaScript side is written the way a JavaScript programmer would write it (typed arrays, object nodes), not made slow on purpose.
The F# side is
Bench.fs; the JavaScript side iskernels.js. - † The F# compiler fuses the three steps of the list pipeline into one loop that allocates nothing; JavaScript allocates three arrays. That row shows the optimisation, not the VM, and is left out of the second mean.
- Browser timers are coarse (0.1 ms and up, and rounded further in some browsers); the kernels are sized so that a run takes milliseconds, not microseconds.
Close other tabs, plug in a laptop, and run the standard profile for numbers worth quoting. Results from other machines are in
docs/benchmarks.md.