Benchmarks
Everything here runs in this browser, on this device. Times are the best of several runs, in milliseconds. Back to Sprout 3
The language
Three small programs, against the same work written in plain JavaScript.
| program | Sprout 3 | plain JS | ratio | answer |
|---|
The games
One frame of each example: update and building the draw list, not painting.
| game | ms per frame | shapes drawn |
|---|
Many particles
A fountain of N particles, stored as columns (decision 82). Update and the draw list are Sprout; painting is Canvas 2D or WebGPU (one draw call). A frame has 16.7 ms at 60 frames a second.
| particles | update | draw list | Canvas 2D | WebGPU (CPU) | WebGPU (all) |
|---|
Monte Carlo with spork
The run from ace-risk.sp: every duration sampled, every risk rolled, and the graph walked five times. spork works it out ahead into one kernel of number math (decision 91). The ordinary way is collect with every fast path off (a fused collect is as fast as the JS kernel), timed on 2,000 runs and scaled. SIMD is WebAssembly, two runs per instruction, with the same bits as JavaScript; the GPU does 32-bit math, and its time includes sending the work and reading the answers back.
| runs | ordinary | JS kernel | SIMD | WebGPU | GPU vs SIMD |
|---|
SQLite
SQLite compiled to WebAssembly (sql.js), the same as the page uses for db. Rows come back as Sprout records.
| work | ms | rows |
|---|