Benchmark Mandelbrot set in full HD resolution.
- js (simple) : vanilla js with main thread rendering to canvas
- js and workers : multi-threaded version, default to 8 concurrent workers (best with 8 core cpus). Rendering is done by dispatching lines of screen across workers. This is done using a SharedArrayBuffer and then mapping it to canvas
cd js_and_worker
start a local web server (because service worker)
python3 -m http.server
http://localhost:8000/mandelbrot.html
Using Laptop with i7-8650U CPU@ 1.9Ghz
test | compute time (Chrome 88.0.4324.190) | compute time (Brave 1.20.110) | compute time (Firefox 85) |
---|---|---|---|
js (simple) | 510 ms | 510 ms | 520 ms |
js and workers single | 100 ms | 110 ms | 120 ms |
js and workers mean 10 frames (Shared Buffer is reused) | 45 ms | 52 ms | 60 ms |