Digitala Vetenskapliga Arkivet

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
A comparative analysis of Wasm performance for different programming paradigms
KTH, School of Electrical Engineering and Computer Science (EECS).
2025 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE creditsStudent thesisAlternative title
En jämförelseanalys av Wasm-prestanda för olika programmeringsparadigmer (Swedish)
Abstract [en]

WebAssembly is an increasingly popular compilation target for high-performance applications across diverse environments, including web, cloud, and Internet of Things platforms. While its language-agnostic design enables support for a wide array of programming languages, the performance implications of different programming paradigms within the Wasm context remain underexplored. This study investigates the extent to which programming paradigms, namely imperative, object-oriented, and functional, influence runtime performance when targeting Wasm. Using a curated subset of benchmarks from the Computer Language Benchmarks Game, implementations were developed in representative languages for each paradigm and evaluated in both native and Wasm environments. The results reveal that while native execution consistently outperforms Wasm, the magnitude of performance degradation varies significantly across paradigms. Imperative languages exhibited the smallest slowdowns, suggesting better alignment with current Wasm compilation and runtime models. However, the analysis highlights that compiler maturity and consistency between native and Wasm toolchains play a more decisive role than paradigm alone. Languages that used the same compiler backend for both environments achieved noticeably better performance. These findings emphasise the importance of robust compiler support in maximising Wasm efficiency and provide guidance for developers and compiler designers targeting Wasm. As a rapidly evolving technology, Wasm tooling and compiler support are still in early development. The disparities observed in this study are therefore subject to change in the future.

Abstract [sv]

WebAssembly är ett alltmer populärt kompileringsmål för högpresterande applikationer i olika miljöer, inklusive webben, molnet och Internet of Things-plattformar. Dess språkagnostiska design möjliggör stöd för en mängd olika programmeringsspråk, men prestandaimplikationerna av olika programmeringsparadigm inom Wasm-kontexten är ännu inte tillräckligt utforskade. Denna studie undersöker i vilken utsträckning programmeringsparadigm, nämligen imperativt, objektorienterat och funktionellt, påverkar körtidsprestanda vid kompileringsmål mot Wasm. Med hjälp av ett urval av riktmärkningstester från Computer Language Benchmarks Game utvecklades implementationer i representativa språk för varje paradigm och utvärderades i både inhemska och Wasm-miljöer. Resultaten visar att även om inhemsk exekvering konsekvent presterar bättre än Wasm, varierar graden av prestandaförsämring mellan paradigmen. Imperativa språk uppvisade de minsta prestandaförlusterna, vilket tyder på en bättre överensstämmelse med nuvarande Wasm-kompilering och körmodeller. Analysen visar dock att kompilatorns mognad och konsistens mellan inhemska- och Wasm-verktygskedjor spelar en mer avgörande roll än själva paradigmet. Språk som använde samma kompilator för båda miljöerna uppnådde märkbart bättre prestanda. Dessa resultat understryker vikten av robust kompilatorstöd för att maximera effektiviteten i Wasm och ger vägledning för utvecklare och kompilatordesigners som riktar sig mot Wasm. Eftersom Wasm är en teknik under snabb utveckling är verktygsstöd och kompilatorer fortfarande i ett tidigt skede. De skillnader som observerats i denna studie kan därför komma att förändras i framtiden.

Place, publisher, year, edition, pages
2025. , p. 41
Series
TRITA-EECS-EX ; 2025:431
Keywords [en]
WebAssembly, Programming paradigms, Object-oriented programming, Functional programming, Imperative programming
Keywords [sv]
WebAssembly, Programmingsparadigmer, Objektorienterad programmering, Funktionell programmering, Imperativ programmering
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:kth:diva-367944OAI: oai:DiVA.org:kth-367944DiVA, id: diva2:1986484
External cooperation
Knowit
Supervisors
Examiners
Available from: 2025-08-10 Created: 2025-07-31 Last updated: 2025-08-10Bibliographically approved

Open Access in DiVA

fulltext(527 kB)487 downloads
File information
File name FULLTEXT01.pdfFile size 527 kBChecksum SHA-512
f47acff1d4c8c6d3fc2fc39a68cc9b5c9e603b60bc20a8e89a49b9708ad735ddcb48acdf1df9b3e508ae549fb0ff7b4ef1c99cb785d57528937ea0b44f4b433c
Type fulltextMimetype application/pdf

By organisation
School of Electrical Engineering and Computer Science (EECS)
Computer and Information Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 493 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: 809 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