Search arXiv⌕ Search

arXiv subjects

Amy Yin

Publications and source records attributed to Amy Yin.

1 recordsLinked to original sources

Evaluating Stack Switching in WebAssembly

Compiling control-flow abstractions like light-weight threads, async/await, and generators to WebAssembly typically requires whole-program transformations that complicate compilation and impose runtime and code-size costs. WasmFX extends WebAssembly with native stack switching based on effect handlers, providing a common foundation for these features. We evaluate WasmFX backends for C, Go, Kotlin, and OCaml and implementation trade-offs in the V8, Wasmtime, and Wizard engines. We compare performance against existing compilation strategies when using these engines. On artificial microbenchmarks involving tight context-switching loops, existing techniques sometimes outperform WasmFX. However, as the stack becomes deeper, WasmFX gains a substantial advantage over Asyncify, the transformation used by our C baseline to emulate stack switching. Even with substantial scope for further optimisation, current WasmFX implementations deliver competitive performance on macrobenchmarks without requiring whole-program transformations.

cs.PL↗