skip to main content
10.1145/3530019.3530034acmotherconferencesArticle/Chapter ViewAbstractPublication PageseaseConference Proceedingsconference-collections
research-article
Open access

Comparing the Energy Efficiency of WebAssembly and JavaScript in Web Applications on Android Mobile Devices

Published: 13 June 2022 Publication History

Abstract

Context. WebAssembly was created as an alternative to JavaScript for developing heavy loading web applications. Since JavaScript is known to have long execution times. A lot of research is already performed to compare the run-time performance of WebAssembly against that of JavaScript. However, little research is available that compares the energy consumption of WebAssembly versus JavaScript. Goal. With this study we aim to identify the correlation between the energy consumption and the use of WebAssembly versus JavaScript. This will aid developers in deciding which method matches the needs of their project best in terms of energy efficiency. Method. The subjects of the experiment are WebAssembly and JavaScript. During the experiment two research questions are defined. For the first research question the programming language is the independent variable. For the second research question the web browser is the independent variable. For both research questions is the energy consumption of the Android device in Joules the dependent variable. Results. We can confirm that the energy consumption of WebAssembly is less than that of JavaScript. The browser also plays a role since the energy consumption of Firefox is significantly smaller than that of Chrome for both WebAssembly and JavaScript. Conclusions. This study provides evidence that using WebAssembly for the development of web applications can reduce the energy consumption and thus improve the battery life of a user’s Android device. Developers can use this information when choosing a programming language to develop a web application. Moreover, using Firefox over Chrome does also reduce the energy consumption of web applications developed both with WebAssembly and JavaScript.

References

[1]
[n.d.]. Building to WebAssembly. https://emscripten.org/docs/compiling/WebAssembly.html#webassembly
[2]
Jebreel Alamari and C. Edward Chow. 2021. Computation at the Edge with WebAssembly. In ITNG 2021 18th International Conference on Information Technology-New Generations, Shahram Latifi (Ed.). Springer International Publishing, Cham, 229–238.
[3]
Luca Ardito, Riccardo Coppola, Maurizio Morisio, and Marco Torchiano. 2019. Methodological Guidelines for Measuring Energy Consumption of Software Applications. Scientific Programming 2019 (2019), 1–16. https://doi.org/10.1155/2019/5284645
[4]
Norman Cliff. 1993. Dominance statistics: Ordinal analyses to answer ordinal questions.Psychological Bulletin 114, 3 (1993), 494–509. https://doi.org/10.1037/0033-2909.114.3.494
[5]
Campbell Cook. 1979. Quasi-experimentation - Design and Analysis Issues for Field Settings.
[6]
Marco Couto, João Saraiva, and João Paulo Fernandes. 2020. Energy Refactorings for Android in the Large and in the Wild. In 2020 IEEE 27th International Conference on Software Analysis, Evolution and Reengineering (SANER). 217–228. https://doi.org/10.1109/SANER48275.2020.9054858
[7]
João de Macedo, João Aloísio, Nelson Gonçalves, Rui Pereira, and João Saraiva. 2020. Energy Wars - Chrome vs. Firefox: Which browser is more energy efficient?. In 2020 35th IEEE/ACM International Conference on Automated Software Engineering Workshops (ASEW). 159–165. https://doi.org/10.1145/3417113.3423000
[8]
David Frankl. 2014. Machine Learning In JavaScript. (2014).
[9]
Isaac Gouy. [n.d.]. The Computer Language Benchmarks Game. https://benchmarksgame-team.pages.debian.net/benchmarksgame/index.html [Online; Consulted 20 September 2021].
[10]
David Herrera, Hangfen Chen, Erick Lavoie, and Laurie Hendren. 2018. WebAssembly and JavaScript Challenge: Numerical program performance using modern browser technologies and devices. University of McGill, Montreal: QC, Technical report SABLE-TR-2018-2 (2018).
[11]
Mohammad Ashraful Hoque, Matti Siekkinen, Kashif Nizam Khan, Yu Xiao, and Sasu Tarkoma. 2015. Modeling, Profiling, and Debugging the Energy Consumption of Mobile Devices. 48, 3, Article 39 (dec 2015), 40 pages. https://doi.org/10.1145/2840723
[12]
Yan Hu, Jiwei Yan, Dong Yan, Qiong Lu, and Jun Yan. 2018. Lightweight energy consumption analysis and prediction for Android applications. Science of Computer Programming 162 (2018), 132–147. https://doi.org/10.1016/j.scico.2017.05.002 Special Issue on TASE 2016.
[13]
Google inc.[n.d.]. V8. https://v8.dev/ [Online; Consulted 20 September 2021].
[14]
Mozilla inc.[n.d.]. Firefox Source Documentation. https://firefox-source-docs.mozilla.org/js/index.html [Online; Consulted 20 September 2021].
[15]
Mozilla inc.[n.d.]. SpiderMonkey. https://spidermonkey.dev/ [Online; Consulted 20 September 2021].
[16]
Abhinav Jangda, Bobby Powers, Emery D. Berger, and Arjun Guha. 2019. Not So Fast: Analyzing the Performance of WebAssembly vs Native Code. Proceedings of the 2019 USENIX Annual Technical Conference (2019), 107–120.
[17]
Vigdis By Kampenes, Tore Dybå, Jo E. Hannay, and Dag I.k. Sjøberg. 2007. A systematic review of effect size in software engineering experiments. Information and Software Technology 49, 11-12 (2007), 1073–1086. https://doi.org/10.1016/j.infsof.2007.02.015
[18]
Daniel Lehmann and Michael Pradel. 2019. Wasabi: A Framework for Dynamically Analyzing WebAssembly. Proceedings of the Twenty-Fourth International Conference on Architectural Support for Programming Languages and Operating Systems (2019). https://doi.org/10.1145/3297858.3304068
[19]
Ivano Malavolta, Eoin Martino Grua, Cheng-Yu Lam, Randy de Vries, Franky Tan, Eric Zielinski, Michael Peters, and Luuk Kaandorp. 2020. A Framework for the Automatic Execution of Measurement-based Experiments on Android Devices. In 35th IEEE/ACM International Conference on Automated Software Engineering Workshops (ASEW ’20). ACM.
[20]
Ivano Malavolta, Giuseppe Procaccianti, Paul Noorland, and Petar Vukmirovic. 2017. Assessing the Impact of Service Workers on the Energy Efficiency of Progressive Web Apps. In 2017 IEEE/ACM 4th International Conference on Mobile Software Engineering and Systems (MOBILESoft). 35–45. https://doi.org/10.1109/MOBILESoft.2017.7
[21]
Antti Miettinen and Jukka Nurminen. 2010. Analysis of the Energy Consumption of JavaScript Based Mobile Web Applications, Vol. 45. 124–135. https://doi.org/10.1007/978-3-642-16644-0_12
[22]
Fernando Oliveira and Júlio Mattos. 2020. Analysis of WebAssembly as a Strategy to Improve JavaScript Performance on IoT Environments. Anais Estendidos do X Simpósio Brasileiro de Engenharia de Sistemas Computacionais (11 2020), 133–138. https://doi.org/10.5753/sbesc_estendido.2020.13102
[23]
Keenan A. Pituch, James Stevens, and James Stevens. 2016. Applied multivariate statistics for the social sciences. Routledge.
[24]
Micha Reiser and Luc Bläser. 2017. Accelerate JavaScript applications by cross-compiling to WebAssembly. 10–17. https://doi.org/10.1145/3141871.3141873
[25]
John J. Kim Robert J. Grissom. 2005. Effect Sizes for Research: A Broad Practical Approach (1 ed.). Routledge Academic. libgen.li/file.php?md5=c8d59f4f79837368fea6d52a6a3da9d2
[26]
Andreas Rossberg. 2016. Webassembly: high speed at low cost for everyone. In ML16: Proceedings of the 2016 ACM SIGPLAN Workshop on ML.
[27]
Prabhjot Sandhu, David Herrera, and Laurie Hendren. 2018. Sparse matrices on the web: Characterizing the performance and optimal format selection of sparse matrix-vector multiplication in JavaScript and WebAssembly. ManLang ’18: Proceedings of the 15th International Conference on Managed Languages and Runtimes, 1–13. https://doi.org/10.1145/3237009.3237020
[28]
Forrest Shull, Janice Singer, and Dag IK Sjøberg. 2007. Guide to advanced empirical software engineering. Springer.
[29]
StatCounter Global Stats. [n.d.]. Browser Market Share Worldwide. https://gs.statcounter.com/browser-market-share#monthly-202110-202110-bar [Online; Consulted 9 January 2022].
[30]
Sasu Tarkoma, Matti Siekkinen, Eemil Lagerspetz, and Yu Xiao. 2014. Smartphone energy consumption: modeling and optimization. Cambridge University Press.
[31]
Claes Wohlin, Per Runeson, Martin Höst, Magnus C Ohlsson, Björn Regnell, and Anders Wesslén. 2012. Experimentation in software engineering. Springer Science and Business Media.

Cited By

View all
  • (2025)Research on WebAssembly Runtimes: A SurveyACM Transactions on Software Engineering and Methodology10.1145/3714465Online publication date: 23-Jan-2025
  • (2024)The Effect of Analytics Tools on Energy Consumption of Websites2024 10th International Conference on ICT for Sustainability (ICT4S)10.1109/ICT4S64576.2024.00041(335-345)Online publication date: 24-Jun-2024
  • (2024)Ten Years of Teaching Empirical Software Engineering in the Context of Energy-Efficient SoftwareHandbook on Teaching Empirical Software Engineering10.1007/978-3-031-71769-7_8(209-253)Online publication date: 25-Dec-2024
  • Show More Cited By

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
EASE '22: Proceedings of the 26th International Conference on Evaluation and Assessment in Software Engineering
June 2022
466 pages
ISBN:9781450396134
DOI:10.1145/3530019
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 13 June 2022

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

EASE 2022

Acceptance Rates

Overall Acceptance Rate 71 of 232 submissions, 31%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)647
  • Downloads (Last 6 weeks)63
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Research on WebAssembly Runtimes: A SurveyACM Transactions on Software Engineering and Methodology10.1145/3714465Online publication date: 23-Jan-2025
  • (2024)The Effect of Analytics Tools on Energy Consumption of Websites2024 10th International Conference on ICT for Sustainability (ICT4S)10.1109/ICT4S64576.2024.00041(335-345)Online publication date: 24-Jun-2024
  • (2024)Ten Years of Teaching Empirical Software Engineering in the Context of Energy-Efficient SoftwareHandbook on Teaching Empirical Software Engineering10.1007/978-3-031-71769-7_8(209-253)Online publication date: 25-Dec-2024
  • (2023)An Overview of WebAssembly for IoT: Background, Tools, State-of-the-Art, Challenges, and Future DirectionsFuture Internet10.3390/fi1508027515:8(275)Online publication date: 18-Aug-2023
  • (2023)Energy-Saving Strategies for Mobile Web Apps and their Measurement: Results from a Decade of Research2023 IEEE/ACM 10th International Conference on Mobile Software Engineering and Systems (MOBILESoft)10.1109/MOBILSoft59058.2023.00017(75-86)Online publication date: May-2023
  • (2023)A Systematic Review of WebAssembly VS Javascript Performance Comparison2023 International Conference on Information Management and Technology (ICIMTech)10.1109/ICIMTech59029.2023.10277917(241-246)Online publication date: 24-Aug-2023

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media