Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
WebAssembly Performance Analysis: A Comparative Study of C++ and Rust Implementations
Blekinge Institute of Technology, Faculty of Computing, Department of Computer Science.
2024 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Abstract [en]

Background: In the contemporary digital landscape, web browsers have evolved from mere text renderers to sophisticated platforms supporting interactive 3D visualizations, multimedia, and gaming applications. This evolution has been catalysed by the advent of WebAssembly, a binary instruction format designed to enhance browser performance by executing high-level language code with near-native efficiency. This thesis investigates the performance implications of WebAssembly modules generated from programs written in C++ and Rust programming languages.

Objectives: The primary aim is to assess the performance of WebAssembly(Wasm) modules generated from Rust and C++ programming languages. This involves conducting a mini literature review on WebAssembly compilation, C++, and Rust semantics and compilation processes. Furthermore, the study aims to evaluate the performance of C++ and Rust Wasm modules encompassing tasks such as sorting and matrix multiplication. Performance metrics including execution time and file size of the obtained Wasm modules are analysed using Chrome’s DevTools. Ultimately, the research endeavours to provide insights into Wasm performance.

Method: In this study, the research method relies on a quantitative experimental approach by writing programs like quicksort and matrix multiplication in both C++and Rust programming languages and compiling them into Wasm modules using compilers like Emscripten for C++ and RustC for Rust programs respectively. Since, the Wasm module is a byte code type it is converted into WebAssembly Text Format (WAT) file for obtaining the readable machine instructions. Performance metrics like execution speed, file size, and number of assembly instructions like add, load, loop, etc are evaluated and calculated using Chrome’s DevTools.

Results: The study which involves a comparative analysis between Wasm modules of C++ and Rust programming languages showcase that the performance of the Rust Wasm module is more fast and efficient in terms of execution time, file size, etc than C++ Wasm module. The findings aim to assist developers in making informed decisions regarding programming language selection for web development, thereby enhancing the efficiency of web applications.

Conclusion: The study has determined that the performance characteristics of WebAssembly modules originating from both C++ and Rust programs vary. The results underscore the superior speed and efficiency of Rust-generated Wasm modules when contrasted with those produced from C++. These insights establish a robust basis for future research and optimization initiatives within the field of web development.

Place, publisher, year, edition, pages
2024. , p. 44
Keywords [en]
C++, Chrome’s DevTools, Emscripten, Rust, Web Browsers, WebAssembly, WAT
National Category
Computer Sciences Engineering and Technology
Identifiers
URN: urn:nbn:se:bth-26632OAI: oai:DiVA.org:bth-26632DiVA, id: diva2:1879948
Subject / course
DV1478 Bachelor Thesis in Computer Science
Educational program
DVGDT Bachelor Qualification Plan in Computer Science 60.0 hp
Presentation
2024-05-23, J1610, Blekinge Institute of Technology, Karlskrona 37141, Karlskrona, 08:00 (English)
Supervisors
Examiners
Available from: 2024-07-01 Created: 2024-06-29 Last updated: 2024-07-01Bibliographically approved

Open Access in DiVA

fulltext(2307 kB)682 downloads
File information
File name FULLTEXT01.pdfFile size 2307 kBChecksum SHA-512
5bc10e543413f48a4436c42d2f3c9b4c0eaa7ff03a040e67a431dbf4a0ec602541ec91aa3a2fa8e241e62be4d360bd6cd5772245cf74a5d29f3122cb29644a42
Type fulltextMimetype application/pdf

By organisation
Department of Computer Science
Computer SciencesEngineering and Technology

Search outside of DiVA

GoogleGoogle Scholar
Total: 682 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 1446 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf