WebAssembly Use Cases
Real products already run WebAssembly in production. Their results show where the format pays off.
A design tool draws many shapes
Figma draws thousands of shapes in one file. This list counts four shapes.
const shapes = ["circle", "square", "triangle", "star"];
console.log(shapes.length);A spreadsheet adds a column
Sheets adds up whole columns at once.
const column = [5, 10, 15];
console.log(column[0] + column[1] + column[2]);Example
(async () => {
const B64 = "AGFzbQEAAAABBwFgAn9/AX8DAgEABwcBA2FkZAAACgkBBwAgACABags=";
const bytes = Uint8Array.from(atob(B64), (c) => c.charCodeAt(0));
const { instance } = await WebAssembly.instantiate(bytes, {});
console.log(instance.exports.add(2, 3));
})();Key points
- Figma reports load times over 3 times faster after its switch to WebAssembly.
- Google Sheets reports recalculation about 2 times faster with WebAssembly.
- Adobe runs Photoshop in the browser with WebAssembly.
- FFmpeg runs in the browser, so video work needs no server round trip.
- SQLite runs in the browser, so apps can query data on the device.
In this example, a small WebAssembly module adds 2 and 3. The same kind of module powers heavy work in real products. Real products already run WebAssembly where speed matters most.
Note
Figures here are reported claims, not promises for your own app.
Try it Yourself
Edit the code, then press Run.
Runs in your browser — the preview under the editor is the real result. Nothing is sent to a server. The code runner panel (right) does the same with more room.
Exercise
Figma reports load times over 3 times faster after switching to WebAssembly. What does that show?