一句话:通过 x86-64 分段和内存标记优化软件故障隔离,提升 WebAssembly 沙箱性能与并发规模。
软件故障隔离(SFI)通过编译器对内存访问插桩实现进程内隔离,是 WebAssembly(Wasm)的关键组成部分,但插桩会带来显著性能开销,并限制大规模并发场景下的可扩展性。本文提出两项优化:Segue 利用 x86-64 分段机制降低内存访问插桩成本;ColorGuard 借助内存标记(如 MPK)提升同一地址空间内可并发运行的 Wasm 实例数量。评估表明,Segue 在 SPEC CPU 2006 的 Wasm 兼容子集上消除了 44.7% 的 Wasm 开销,并将 Firefox 中 Wasm 沙箱化字体渲染的开销降低 75%;ColorGuard 可将并发 Wasm 实例数提升最多 15 倍,改善高规模服务端工作负载的效率。作者还探讨了在 Wasm2c、WAMR 和 Wasmtime 三个生产工具链中部署这些优化所面临的挑战。
Software-based fault isolation (SFI) enables in-process isolation through compiler instrumentation of memory accesses, and is a critical part of WebAssembly (Wasm). We present two optimizations that improve SFI performance and scalability: Segue uses x86-64 segmentation to reduce the cost of instrumentation on memory accesses, e.g., it eliminates 44.7% of Wasm's overhead on a Wasm-compatible subset of SPEC CPU 2006, and reduces overhead of Wasm-sandboxed font rendering in Firefox by 75%; ColorGuard leverages memory tagging (e.g., MPK), to enable up to a 15× increase in the number of Wasm instances that can run concurrently in a single address space, improving efficiency for high scale server-side workloads. We also explore the challenges of deploying these optimizations in three production toolchains: Wasm2c, WAMR and Wasmtime.
@inproceedings{NarayanG0YWBVLH25,
title = {Segue & ColorGuard: Optimizing SFI Performance and Scalability on Modern Architectures},
author = {Shravan Narayan and Tal Garfinkel and Evan Johnson and Zachary Yedidia and Yingchen Wang and Andrew Brown and Anjo Vahldiek-Oberwagner and Michael LeMay and Wenyong Huang and Xin Wang and Mingqiu Sun and Dean Tullsen and Deian Stefan},
booktitle = {ASPLOS},
year = {2025},
doi = {10.1145/3669940.3707249}
}