Post

A Gaussian blur in Canvas 2D takes 280ms. The same filter with WebGPU: 8ms. I wrote the second article in the WebGPU series: image processing in the browser with WGSL shaders and real benchmarks. joanleon.dev/en/webgpu-im... #WebPerf #WebGPU #JavaScript #Performance

joanleon.devImage processing in the browser with WebGPU | Joan LeónHow to use WebGPU to apply filters and transformations to images in the browser. Real benchmarks comparing with Canvas 2D.
Joan León@nucliweb.net

For years, the performance ceiling in the browser has been clear: the CPU. WebGPU changes that. 🧵 It’s not a library or a framework. It’s a browser API that gives direct access to the device’s GPU, enabling a level of parallelism the CPU cannot match. #WebPerf #WebGPU

2 reposts7 likes

Fair point! WebGL is definitely the battle-tested veteran here. I focused on WebGPU to showcase the modern API and its compute shader capabilities, which handle memory and parallelization differently. 🧵

The 280ms isn't all compute — Canvas2D getImageData/readback + a JS loop dominate. For separable kernels, WASM+SIMD in a Worker gets close without a secure context. WebGPU's real win is large non-separable filters and full pipelines.

8ms vs 280ms is a great benchmark. One gotcha from shipping browser image tools: WebGPU still has holes on Safari/iOS, so a Canvas2D/WebGL fallback saves a chunk of users from a blank canvas. The WGSL work pays off once baseline support lands.