203 research outputs found
WebAssembly versus JavaScript: Energy and runtime performance
The worldwide Web has dramatically evolved in recent years. Web pages are dynamic, expressed by programs written in common programming languages given rise to sophisticated Web applications. Thus, Web browsers are almost operating systems, having to interpret/compile such programs and execute them. Although JavaScript is widely used to express dynamic Web pages, it has several shortcomings and performance inefficiencies. To overcome such limitations, major IT powerhouses are developing a new portable and size/load efficient language: WebAssembly.In this paper, we conduct the first systematic study on the energy and run-time performance of WebAssembly and JavaScript on the Web. We used micro-benchmarks and also real applications in order to have more realistic results. Preliminary results show that WebAssembly, while still in its infancy, is starting to already outperform JavaScript, with much more room to grow. A statistical analysis indicates that WebAssembly produces significant performance differences compared to JavaScript. However, these differences differ between micro-benchmarks and real-world benchmarks. Our results also show that WebAssembly improved energy efficiency by 30%, on average, and showed how different WebAssembly behaviour is among three popular Web Browsers: Google Chrome, Microsoft Edge, and Mozilla Firefox. Our findings indicate that WebAssembly is faster than JavaScript and even more energy-efficient. Additionally, our benchmarking framework is also available to allow further research and replication.This work is financed by National Funds through the Portuguese funding agency, FCT -Fundacao para a Ciencia e a Tecnologia within project UIDB/50014/2020. Additionally, this paper acknowledges the support of the Erasmus+ Key Action 2 project No. 2020-1-PT01-KA203-078646: "SusTrainable -Promoting Sustainability as a Fundamental Driver in Software Development Training and Education"
Benchmarking AssemblyScript for Faster Web Applications
As web applications are becoming increasingly complex, it is crucial now more than ever to be able to develop web apps with an emphasis on performance to ensure a responsive and smooth user experience. Since the introduction of Webassembly as a compilation target for the web, the promise of writing programs that can run at native speed seemed revolutionary in theory. But the real world performance benefits of Webassembly in comparison to Javascript is not clearly understood. This paper evaluates the current performance of Assemblyscript - a strict subset of TypeScript that compiles to Webassembly, and Javascript in the areas of numerical computing across multiple browsers. A set of benchmarks were developed in Assemblyscript that includes numerical computing problems from the Ostrich Benchmark suite. The tests were executed across Chrome and Firefox. After studying the results from the benchmarks that were created, we find that Assemblyscript demonstrates speedups that range between 1.1-7.2x. It is also noticed that writing idiomatic Typescript can slow down Assemblyscript in certain scenarios. In conclusion, this study suggests that Assemblyscript (and Webassembly) provides far more consistent and predictable performance in comparison to Javascript
Rasm: Compiling Racket to WebAssembly
WebAssembly is an instruction set designed for a stack based virtual machine, with an emphasis on speed, portability and security. As the use cases for WebAssembly grow, so does the desire to target WebAssembly in compilation. In this thesis we present Rasm, a Racket to WebAssembly compiler that compiles a select subset of the top forms of the Racket programming language to WebAssembly. We also present our early findings in our work towards adding a WebAssembly backend to the Chez Scheme compiler that is the backend of Racket. We address initial concerns and roadblocks in adopting a WebAssembly backend and propose potential solutions and patterns to address these concerns. Our work is the first serious effort to compile Racket to WebAssembly, and we believe it will serve as a good aid in future efforts of compiling high-level languages to WebAssembly
Stop Hiding The Sharp Knives: The WebAssembly Linux Interface
WebAssembly is gaining popularity as a portable binary format targetable from
many programming languages. With a well-specified low-level virtual instruction
set, minimal memory footprint and many high-performance implementations, it has
been successfully adopted for lightweight in-process memory sandboxing in many
contexts. Despite these advantages, WebAssembly lacks many standard system
interfaces, making it difficult to reuse existing applications.
This paper proposes WALI: The WebAssembly Linux Interface, a thin layer over
Linux's userspace system calls, creating a new class of virtualization where
WebAssembly seamlessly interacts with native processes and the underlying
operating system. By virtualizing the lowest level of userspace, WALI offers
application portability with little effort and reuses existing compiler
backends. With WebAssembly's control flow integrity guarantees, these modules
gain an additional level of protection against remote code injection attacks.
Furthermore, capability-based APIs can themselves be virtualized and
implemented in terms of WALI, improving reuse and robustness through better
layering. We present an implementation of WALI in a modern WebAssembly engine
and evaluate its performance on a number of applications which we can now
compile with mostly trivial effort.Comment: 12 pages, 8 figure
WASM-MUTATE: Fast and Effective Binary Diversification for WebAssembly
WebAssembly has is renowned for its efficiency and security in browser
environments and servers alike. The burgeoning ecosystem of WebAssembly
compilers and tools lacks robust software diversification systems. We introduce
WASM-MUTATE, a compiler-agnostic WebAssembly diversification engine. It is
engineered to fulfill the following key criteria: 1) the rapid generation of
semantically equivalent yet behaviorally diverse WebAssembly variants, 2)
universal applicability to any WebAssembly programs regardless of the source
programming language, and 3) the capability to counter high-risk security
threats. Utilizing an e-graph data structure, WASM-MUTATE is both fast and
effective. Our experiments reveal that WASM-MUTATE can efficiently generate
tens of thousands of unique WebAssembly variants in a matter of minutes.
Notably, WASM-MUTATE can protect WebAssembly binaries against timing
side-channel attacks, specifically, Spectre
Mechanising and verifying the WebAssembly specification
WebAssembly is a new low-level language currently being implemented in all major web browsers. It is designed to become the universal compilation target for the web, obsoleting existing solutions in this area, such as asm.js and Native Client. The WebAssembly working group has incorporated formal techniques into the development of the language, but their efforts so far have focussed on pen and paper formal specification.
We present a mechanised Isabelle specification for the WebAssembly language, together with a verified executable interpreter and type checker. Moreover, we present a fully mechanised proof of the soundness of the WebAssembly type system, and detail how our work on this proof has exposed several issues with the official WebAssembly specification, influencing its development. Finally, we give a brief account of our efforts in performing differential fuzzing of our interpreter against industry implementations
- …