Skip to main content
  1. Posts/

Conway's Game of Life

·186 words·1 min
javascript wasm webgpu parallel computing
Zhenzhong "Anthony" Tang
Author
Zhenzhong “Anthony” Tang
Student, Researcher, and Developer
Table of Contents

JavaScript vs WebAssembly vs WebGPU

This is a performance demanding page.

Introduction
#

A single Gosper’s glider gun creating gliders.
Source: Wikipedia

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.

References
#

toytag/conway-game-of-life

JavaScript, WebAssembly, and WebGPU implementations of the well-known Conway’s Game of Life.

TypeScript
0
0

Related

Path Tracer: Physically Based Rendering
·1593 words·8 mins
cuda parallel computing physically based rendering ray tracing
Efficient Large Language Model Inference
·3415 words·17 mins
cuda parallel computing
Path Tracing Denoiser
·689 words·4 mins
cuda parallel computing physically based rendering ray tracing