Conway's Game of Life
Table of Contents
JavaScript vs WebAssembly vs WebGPU
Introduction#
The project conducted performance comparisons between vanilla JavaScript, WebAssembly, and WebGPU. The WebGPU version is the fastest. When tested on a desktop Intel 12600K with integrated GPU, the WebGPU compute shader achieved around 10x speed-up, with FPS capped at 60. While the other two implementations struggled to reach 20 FPS.
On the mobile end, unfortunately, WebGPU is not yet supported by mobile browsers. WebAssembly is the fastest here, surpassing its desktop counterpart. The WebAssembly version is around 2x faster than the vanilla JavaScript version. On a mainstream mobile device like iPhone, the WebAssembly version can achieve around 30 FPS.
Demo#
https://conway-game-of-life.toytag.net
The simulation resolution is 1024x1024. The embedded demo is default to WebGPU version as it more efficient and less CPU intensive.