Optimizing WebAssembly Garbage Collection in Go: Performance Insights, Tuning Tips, and Batch Execution Strategies
Author(s) -
Safia Guellil,
Marc Sanchez-Artigas
Publication year - 2025
Publication title -
2025 ieee 45th international conference on distributed computing systems (icdcs)
Language(s) - English
Resource type - Conference proceedings
eISSN - 2575-8411
ISBN - 979-8-3315-1723-6
DOI - 10.1109/icdcs63083.2025.00071
Subject(s) - communication, networking and broadcast technologies , computing and processing
WebAssembly is gaining popularity these days as a portable intermediate binary format for programming languages. With a well-specified low-level virtual instruction set, low memory footprint and high-performance virtual machines, it has arisen as a lightweight alternative to containers. Even the tiniest container typically sits somewhere around tens of MBs and requires several hundred MBs of memory to run, which is infeasible in resource-constrained edge devices. Though WebAssembly has been battle-tested for memory unmanaged languages such as C++, there exists a systematic lack of investigation on managed languages such as Golang that utilize a garbage collector (GC). Taking TinyGo as a paradigmatic example, we study in this paper the implications of garbage collection for WebAssembly. We show that WebAssembly introduces some inefficiencies compared to native execution and share tips on how to raise its performance. Yet more compelling, we demonstrate that it is possible to dynamically adjust the GC by rewriting the WebAssembly binaries, and in this way, control the impact of garbage collection on the execution time by trading off extra memory. In edge contexts, this ability is essential to fine-tune the execution of a batch of WebAssembly jobs over the same physical device as shown here for the first time.
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom