And that’s with Wasm still in its early days.
“Wasm is still in its infancy and only time could tell us how it will evolve,” study author João De Macedo, a software engineer, told The New Stack via email. “In our wildest predictions, we see Wasm completely pushing out native apps from operating systems and crowning the web browser as the operating system of the twenty-first century.”
Micro-Benchmarks vs. Real-World Applications
The research, published in 2022, looked at real-world benchmarks, as well as micro-benchmarks.
“A micro-benchmark is a program that tracks and measures the performance of a single well-defined task such as elapsed time, rate of operation, bandwidth, etc.,” De Macedo explained. “Micro-benchmarking is one of the principal ways to measure the performance of a software system, thus, Wasm is no exception.
Since one of the main goals of Wasm is to improve the performance of Web applications, it’s “particularly relevant to compare the run-time and energy performance of Wasm and JS,” he added.
That said, ultimately Wasm still ruled overall in real-world applications.
“This game console includes six different open source games that can be executed by the console,” the report stated. “We updated the WasmBoy source code in order to specify the browser where the games have to be executed.”
So with six games running across three browsers — Chrome, Edge and Firefox — with two languages, the team had a total of 36 unique samples.
“Similar to the Wasmboy benchmark, we developed makefiles to automate the execution in the different browsers,” resulting in five samples in each language across three browsers for 30 unique program executions, the report stated.
However, the long and short of it is that this approach allowed the team to look at, for instance, how scale and input size were handled differently by JS and Wasm. A previous study had used this approach, but only looked at performance in virtual machines. De Macedo’s study wanted to look at real-world applications, so the team developed a framework to measure performance within a browser-based environment.
“Maybe never, because JS makes more sense to web pages that don’t need to be ultra-performance,” he responded. “Currently, Wasm serves as a supplement to JS rather than a replacement. However, if Wasm were further developed, it might take the place of JS in some applications because of its faster loading times and more effective resource usage.”
Long-term, De Macedo predicted Wasm will be disruptive.
“Wasm will not only revolutionize the web,” he said. “The promise of WebAssembly has the potential to upend multiple areas of the technology market — including the cloud — which recently has increasingly shifted to a container model that doesn’t always serve every organization’s needs.”