Sprout 3

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.

programSprout 3plain JSratioanswer

The games

One frame of each example: update and building the draw list, not painting.

gamems per frameshapes 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.

particlesupdatedraw listCanvas 2DWebGPU (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.

runsordinaryJS kernelSIMDWebGPUGPU vs SIMD

SQLite

SQLite compiled to WebAssembly (sql.js), the same as the page uses for db. Rows come back as Sprout records.

workmsrows