WebAssembly
WebAssembly (Wasm) is a portable format for compiled instructions, designed to keep code compact and execute it efficiently. Browsers can run Wasm modules alongside JavaScript, and the WebAssembly System Interface gives programs a way to request services from other hosts. Performance depends on the task and the software running it (Rossberg, 2019; Ehrenberg, 2019; WASI Subgroup, n.d.a; Yan et al., 2021; Jangda et al., 2019). The security model limits what a module can access, while bugs can persist in compiled code (WebAssembly, n.d.b; Lehmann et al., 2020). Studies disagree on how much web Wasm serves cryptomining and obfuscation (Musch et al., 2019; Hilbig et al., 2021).
Modules in a browser
The core specification defines the code format, and the browser interface defines how code on a page interacts with it. The World Wide Web Consortium (W3C) published WebAssembly Core 1.0 as a Recommendation in December 2019. A module is a unit of compiled Wasm code. When JavaScript creates a runnable instance of a module, it supplies the module’s imports, which are values or functions the module needs from outside. JavaScript can then use the module’s exports, such as functions it makes available to the rest of the page (Rossberg, 2019; Ehrenberg, 2019).
A compiler can produce Wasm from several source languages. Emscripten compiles C and C++ to Wasm and can generate JavaScript that provides services to the compiled code. Rust also has a compilation target commonly used for the web and other JavaScript environments (Emscripten, n.d.; The Rust Project, n.d.l).
SIMD, garbage collection and threads
Wasm 2.0 added fixed-width SIMD. Short for single instruction, multiple data, SIMD lets an instruction act on several values at once. Wasm 3.0 added garbage collection, which lets the runtime reclaim memory that the program can no longer reach (WebAssembly, n.d.a).
The threads proposal allows several threads, or paths of execution, to use the same memory. The host creates the threads. Wasm instructions let those threads coordinate their access to shared memory (WebAssembly, 2023).
WASI and the Component Model
The WebAssembly System Interface (WASI) defines services that a host can provide to Wasm programs across environments, including cloud servers and embedded devices. For example, the interfaces for command-line programs include reading and writing files, generating random numbers and checking the time. The host explicitly grants a program access to outside resources (WASI Subgroup, n.d.a; Bytecode Alliance, n.d.c; WASI Subgroup, n.d.b).
The Component Model defines how separately compiled pieces fit together, including pieces written in different languages. A component can package core modules or other components. The interfaces specify the kinds of values each piece accepts or returns. Two pieces can connect when what one exports meets what the other imports (Bytecode Alliance, n.d.a; Bytecode Alliance, n.d.b).
WASI 0.3.0 shipped on June 11, 2026. It uses the Component Model’s built-in support for asynchronous operations, which let work proceed while another operation is pending. In June 2026 the Bytecode Alliance still described a stable, formally specified Component Model 1.0 as a future milestone. The W3C working group’s August 2026 charter makes its work on a formal specification conditional on the proposal reaching Phase 4 of its standards process (WASI Subgroup, n.d.c; Gregory, 2026; World Wide Web Consortium, 2026h).
Speed compared with JavaScript and native code
Wasm’s speed relative to JavaScript varies with the program and the execution environment. In 2018 the Wasm version of the Ostrich numerical tests outperformed the JavaScript version overall on the tested browsers and devices. The Wasm and JavaScript versions of Hyphenopoly.js took similar time to find where to hyphenate words in the tested English and French texts. That study appeared in 2021 and used browser releases from around December 2019 (Herrera et al., 2018; Yan et al., 2021).
Two implementations can also divide the same work differently. In the 2021 study’s FFmpeg media conversion test, the Wasm version split conversion among several workers. The tested JavaScript version ran the conversion serially (Yan et al., 2021).
Against native code, which is compiled for the device’s processor, the size of the slowdown depends on what the benchmark runs. Seven PolyBenchC tests in the 2017 design paper ran within 10% of native performance. In a 2019 SPEC CPU benchmark study, Wasm took 1.55 times as long as native in Chrome 74 and 1.45 times as long in Firefox 66. Those figures are geometric means, which summarise the ratios of Wasm to native execution time across programs (Haas et al., 2017; Jangda et al., 2019).
A speed score also depends on which runs it counts. JetStream 3 uses the same scoring method for JavaScript and Wasm. It measures the first run, the slowest runs and the average of subsequent runs (Miller, 2026).
How often websites load Wasm
The HTTP Archive detected Wasm on a small share of the sites it crawled. The 2025 Web Almanac identified Wasm using the response’s declared content type and the .wasm file extension. This counts visible requests for Wasm files. An execution-based measurement can also see modules embedded directly in JavaScript when they run (VN et al., 2025; Hilbig et al., 2021).
| HTTP Archive crawl | Desktop | Mobile |
|---|---|---|
| September 1, 2021 | 0.06% of domains | 0.04% of domains (Stepanyan et al., 2021) |
| July 2025 | 0.35% of sites | 0.28% of sites (VN et al., 2025) |
Security and misuse
Wasm’s security model runs each module in a sandbox, an environment isolated from the host runtime. The module reaches resources outside the sandbox through interfaces the host authorises. Within the module, source code bugs involving incorrect memory access can survive compilation (WebAssembly, n.d.b; Lehmann et al., 2020).
The runtime, the software that executes Wasm, can also have defects. One study tested seven runtimes and reported 60 previously unreported bugs. By publication, developers had confirmed 13 and fixed 9 (Zhang et al., 2023a).
Cryptomining and obfuscation on the web
Studies disagree on how much web Wasm serves cryptomining, which performs computations for a cryptocurrency, and obfuscation, which makes code harder to inspect. A 2019 study of the Alexa Top 1 million reported activity it classified as malicious on over half of the sampled sites where Wasm ran. That category included mining and obfuscation (Musch et al., 2019; Hilbig et al., 2021).
A separate study collected binaries, or compiled files, from April to September 2020. It associated less than 1% of the collected web binaries with mining and warned that its analysis could miss miners. The earlier study counted sites and included several kinds of activity. The later figure measures the share of collected files linked to mining alone. The two estimates leave the change in malicious use over time unresolved (Musch et al., 2019; Hilbig et al., 2021).
In that April–September 2020 sample, the researchers found 28.8% of web binaries minified (Hilbig et al., 2021).
Further reading
- Rossberg (2019) defines the core format and identifies the first W3C Recommendation.
- Bytecode Alliance (n.d.a) explains how component imports and exports connect.
- Yan et al. (2021) compares Wasm and JavaScript implementations across programs and environments.
- VN et al. (2025) describes how the Web Almanac detects and counts Wasm files.
- Hilbig et al. (2021) explains what changes when a study counts binaries and tracks modules as they run.
First published .
Known gaps
What this article cannot tell you yet.
- Browser support for individual WebAssembly features was outside the scope of the specification comparison.
- The browser speed comparisons use historical browser releases. The article has no equivalent comparison across current releases.
- The web measurements give snapshots of detected use. They leave adoption in standalone runtimes unmeasured.
References
- Solid source
- Rated highly trustworthy by the research, and every passage taken from it was found in it.
- Weak source
- Rated low, or a passage taken from it was not found in it.
- Medium trust
- Rated medium by the research.
- Not checked
- Rated high, but its passages could not all be checked against it.
Show all 26 references
- Bytecode Alliance (n.d.a). Components. The WebAssembly Component Model. https://component-model.bytecodealliance.org/design/components.html Solid source Documentation, read in large part.
- Bytecode Alliance (n.d.b). Why the Component Model? The WebAssembly Component Model. https://component-model.bytecodealliance.org/design/why-component-model.html Medium trust Documentation, read in large part.
- Bytecode Alliance (n.d.c). Worlds. The WebAssembly Component Model. https://component-model.bytecodealliance.org/design/worlds.html Solid source Documentation, read in large part.
- Ehrenberg, D. (2019). WebAssembly JavaScript Interface. World Wide Web Consortium. https://www.w3.org/TR/wasm-js-api-1/ Solid source Documentation, read in large part.
- Emscripten (n.d.). About Emscripten. Emscripten documentation. https://emscripten.org/docs/introducing_emscripten/about_emscripten.html Medium trust Documentation, read in large part.
- Gregory, E. (2026). The Road to Component Model 1.0. Bytecode Alliance. https://bytecodealliance.org/articles/the-road-to-component-model-1-0 Medium trust Blog post, read in large part.
- Haas, A., Rossberg, A., Schuff, D. L., Titzer, B. L., Holman, M., Gohman, D., et al. (2017). Bringing the Web up to Speed with WebAssembly. Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation. https://people.mpi-sws.org/~rossberg/papers/Haas%2C%20Rossberg%2C%20Schuff%2C%20Titzer%2C%20Gohman%2C%20Wagner%2C%20Zakai%2C%20Bastien%2C%20Holman%20-%20Bringing%20the%20Web%20up%20to%20Speed%20with%20WebAssembly.pdf Medium trust Peer-reviewed, read in large part.
- Herrera, D., Chen, H., Lavoie, E., & Hendren, L. (2018). Numerical Computing on the Web: Benchmarking for the Future. Proceedings of the 14th ACM SIGPLAN International Symposium on Dynamic Languages. https://www.sable.mcgill.ca/publications/papers/2018-2/herrera-18-wasm.pdf Solid source Peer-reviewed, read in large part.
- Hilbig, A., Lehmann, D., & Pradel, M. (2021). An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases. Proceedings of the Web Conference 2021, 2696–2708, ACM. https://dlehmann.eu/publications/WasmBench-www2021.pdf Solid source Peer-reviewed, read in large part.
- Jangda, A., Powers, B., Berger, E. D., & Guha, A. (2019). Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code. 2019 USENIX Annual Technical Conference. https://www.usenix.org/system/files/atc19-jangda.pdf Solid source Peer-reviewed, read in large part.
- Lehmann, D., Kinder, J., & Pradel, M. (2020). Everything Old is New Again: Binary Security of WebAssembly. 29th USENIX Security Symposium, 217–234. https://www.usenix.org/conference/usenixsecurity20/presentation/lehmann Medium trust Peer-reviewed, abstract only.
- Miller, K. (2026). Introducing the JetStream 3 Benchmark Suite. WebKit. https://webkit.org/blog/17899/introducing-the-jetstream-3-benchmark-suite/ Medium trust Blog post, read in large part.
- Musch, M., Wressnegger, C., Johns, M., & Rieck, K. (2019). New Kid on the Web: A Study on the Prevalence of WebAssembly in the Wild. Detection of Intrusions and Malware, and Vulnerability Assessment (DIMVA), 23–42, Springer. https://www.tu-braunschweig.de/index.php?eID=dumpFile&f=74903&t=f&token=98edc47c0bcb0a04635ade4903797fba650e86fa Solid source Book, read in large part.
- Rossberg, A. (2019). WebAssembly Core Specification. World Wide Web Consortium. https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/ Solid source Documentation, read in large part.
- The Rust Project (n.d.l). wasm32-unknown-unknown. The rustc book. https://doc.rust-lang.org/rustc/platform-support/wasm32-unknown-unknown.html Solid source Documentation, read in large part.
- Stepanyan, I., Overson, J., Piovesan, C., Zakai, A., Viscomi, R., Pollard, B., & Hantsis, S. (2021). WebAssembly (2021 Web Almanac). The 2021 Web Almanac, chapter 6, HTTP Archive. https://almanac.httparchive.org/en/2021/webassembly Solid source Read in large part.
- VN, N. V. -., Demir, N., & Pollard, B. (2025). WebAssembly (2025 Web Almanac). The 2025 Web Almanac, chapter 2, HTTP Archive. https://almanac.httparchive.org/en/2025/webassembly Solid source Read in large part.
- World Wide Web Consortium (2026h). WebAssembly Working Group Charter. World Wide Web Consortium. https://www.w3.org/2026/06/webassembly-wg.html Solid source Government report, read in large part.
- WASI Subgroup (n.d.a). Introduction. WASI.dev. https://wasi.dev/ Solid source Documentation, read in large part.
- WASI Subgroup (n.d.c). WASI 0.3. WASI.dev. https://wasi.dev/releases/wasi-p3 Solid source Documentation, read in large part.
- WASI Subgroup (n.d.b). Security. WASI.dev. https://wasi.dev/security Solid source Documentation, read in large part.
- WebAssembly (n.d.a). Finished Proposals. WebAssembly Proposals. https://github.com/WebAssembly/proposals/blob/main/finished-proposals.md Solid source Documentation, read in large part.
- WebAssembly (n.d.b). Security. WebAssembly. https://webassembly.org/docs/security/ Solid source Documentation, read in large part.
- WebAssembly (2023). Change History — WebAssembly 2.0 + Threads (Draft 2023-10-10). WebAssembly. https://webassembly.github.io/threads/core/appendix/changes.html Solid source Documentation, read in large part.
- Yan, Y., Tu, T., Zhao, L., Zhou, Y., & Wang, W. (2021). Understanding the Performance of WebAssembly Applications. Proceedings of the 21st ACM Internet Measurement Conference. https://weihang-wang.github.io/papers/imc21.pdf Solid source Peer-reviewed, read in large part.
- Zhang, Y., Cao, S., Wang, H., Chen, Z., Luo, X., Mu, D., et al. (2023a). Characterizing and Detecting WebAssembly Runtime Bugs. ACM Transactions on Software Engineering and Methodology, 33(2), Article 37. https://chenzhenpeng18.github.io/papers/TOSEM23-WebAssembly.pdf Solid source Peer-reviewed, read in large part.