WATaBoy: JIT-Ing Game Boy Instructions to WASM Beats a Native Interpreter
Points and comments are a snapshot, not live.
JIT-to-WASM compilation for a Game Boy emulator outperforms a native interpreter.
The author built WATaBoy, a Game Boy emulator using just-in-time compilation to WebAssembly, to work around iOS JIT restrictions. WASM bytecode is generated at runtime, compiled and instantiated by the browser's JS engine, and linked via an indirect function table. Benchmarks on a MacBook Air M2 in Safari show the JIT-to-WASM approach reaching ~1.2x the speed of the same emulator's interpreter running natively for Pokémon Blue. The technique could apply to other CPU-bound emulators on iOS, though PPU overhead and basic-block boundaries remain performance bottlenecks.
What commenters are saying
Commenters broadly praised the project as impressive undergraduate work. A key debate emerged over the iOS motivation: one commenter pointed to existing sideloaded apps using debug entitlements for JIT, while others countered this is impractical for distribution or requires user-hostile tethering. Several noted WASM's JIT overhead (~20%) is far lower than interpreter overhead (~1000%), making the result unsurprising but still cool. Firefox was observed to be 25% slower than Chrome and Safari in the benchmarks. Some commenters compared to historical efforts (Dolphin/LLVM, Jamulator) and noted JS eval-based JITs as simpler alternatives for emulation.