Everything on this page is computed twice: once by a 16 KiB Rust module compiled to WebAssembly (wasm-labs/src/lib.rs in this repository) and once by the same algorithm written in JavaScript. Nothing is sent to a server. The module uses no bindings generator — the page calls its exported C-ABI functions directly, as described in the WebAssembly lesson.
Click to zoom in, shift-click to zoom out. Each frame is rendered by both engines.
Frame time
Two different shapes of work: a sieve that hammers memory, and naive recursion that is nothing but function calls. Modern JavaScript engines are fast — expect the gap to be smaller than folklore suggests, and to vary by browser. That is the honest lesson.
| Task | Result | Rust → wasm | JavaScript | |
|---|---|---|---|---|
| Count primes below 20,000,000 | – | – | – | |
| Recursive fib(38) | – | – | – |