Stress / 03

WebGPU compute.

Dispatches a parallel multiply-add shader and reports GOps/sec. A direct read on raw compute throughput, separate from rasterisation.

Notes

WebGPU ships in Chrome 113+, Edge 113+, Safari 18+. On browsers without WebGPU you'll see 'unsupported'.

How it works

We request a GPU adapter, compile a tiny WGSL compute shader that does 512 multiply-add iterations per input element across 1 million elements, dispatch it 30 times, and wait for device.queue.onSubmittedWorkDone(). Wall-clock time divided into total ops gives the GOps/s figure.

A warmup dispatch is run first to absorb shader-compile cost and let the GPU clocks ramp up. The reported number is steady-state throughput, not first-frame burst.

Frequently asked

What is WebGPU?

WebGPU is the modern successor to WebGL. It exposes the GPU's compute pipeline (not just rasterisation), uses lower-level command buffers like Vulkan / Metal / D3D12, and is the API serious browser-based machine-learning and physics simulations will be built on. It ships in Chrome 113+, Edge 113+, and Safari 18+.

What does GOps/s mean?

Giga-operations per second — billions of fused multiply-adds (or equivalent ops) per second. Our shader does 512 multiply-add steps per input element across 1 million elements, then we dispatch 30 times. Total ops / total wall time gives the GOps/s figure. A modern dGPU lands in 100-500 GOps/s on this workload; integrated GPUs hit 5-30.

Why is WebGPU slower than native CUDA / Metal?

Browser sandbox overhead plus the WebGPU validation layer add a few percent at most for steady-state compute. The bigger gap is feature parity — WebGPU lacks some advanced compute primitives (subgroup ops, FP16 in widespread support) that native APIs ship. For straight matmul / convolution, performance is typically 80-95% of native.

Why does my browser say 'unsupported'?

Firefox doesn't ship WebGPU yet (behind dom.webgpu.enabled in about:config). Older Chrome / Edge (<113) lack it. On Linux, a small number of GPU + driver combinations remain blocked for safety. Update your browser, or try Chrome Canary.

How does this compare to the WebGL benchmark?

WebGL measures rasterisation throughput — triangles per frame. WebGPU compute measures raw arithmetic throughput. They correlate (a fast GPU is fast at both) but they measure different sub-pipelines. Run both: WebGL maxes out the geometry / fragment pipeline; WebGPU maxes out compute units.