TLDR Web Dev · ARTICLES & TUTORIALS

WHY GOOGLE SHEETS PORTED ITS CALCULATION WORKER FROM JAVASCRIPT TO WASMGC

web.dev6 min read

Summary from the TLDR Web Dev newsletter

Google Sheets initially used a Java-based calculation engine, but later switched to JavaScript for browser-based calculations. Due to performance limitations of JavaScript compared to Java, Google used WasmGC, an extension to WebAssembly that allows for efficient compilation of garbage-collected languages like Java. The initial prototype was slower than JavaScript, but optimizations like replicating JVM/V8 optimizations, using browser APIs, and making code more platform-agnostic resulted in huge performance improvements.