An extensible approach for taming the challenges of JavaScript dead code elimination

Niels Groot Obbink, Ivano Malavolta, Gian Luca Scoccia, Patricia Lago*

*Corresponding author for this work

Research output: Chapter in Book / Report / Conference proceedingConference contributionAcademicpeer-review

Abstract

JavaScript is becoming the de-facto programming language of the Web. Large-scale web applications (web apps) written in Javascript are commonplace nowadays, with big technology players (e.g., Google, Facebook) using it in their core flagship products. Today, it is common practice to reuse existing JavaScript code, usually in the form of third-party libraries and frameworks. If on one side this practice helps in speeding up development time, on the other side it comes with the risk of bringing dead code, i.e., JavaScript code which is never executed, but still downloaded from the network and parsed in the browser. This overhead can negatively impact the overall performance and energy consumption of the web app. In this paper we present Lacuna, an approach for JavaScript dead code elimination, where existing JavaScript analysis techniques are applied in combination. The proposed approach supports both static and dynamic analyses, it is extensible, and independent of the specificities of the used JavaScript analysis techniques. Lacuna can be applied to any JavaScript code base, without imposing any constraints to the developer, e.g., on her coding style or on the use of some specific JavaScript feature (e.g., modules). Lacuna has been evaluated on a suite of 29 publicly-available web apps, composed of 15,946 JavaScript functions, and built with different JavaScript frameworks (e.g., Angular, Vue.js, jQuery). Despite being a prototype, Lacuna obtained promising results in terms of analysis execution time and precision.

Original languageEnglish
Title of host publication25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018 - Proceedings
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages391-401
Number of pages11
Volume2018-March
ISBN (Electronic)9781538649695
DOIs
Publication statusPublished - 2018
Event25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018 - Campobasso, Italy
Duration: 20 Mar 201823 Mar 2018

Conference

Conference25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018
CountryItaly
CityCampobasso
Period20/03/1823/03/18

Fingerprint Dive into the research topics of 'An extensible approach for taming the challenges of JavaScript dead code elimination'. Together they form a unique fingerprint.

  • Cite this

    Obbink, N. G., Malavolta, I., Scoccia, G. L., & Lago, P. (2018). An extensible approach for taming the challenges of JavaScript dead code elimination. In 25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018 - Proceedings (Vol. 2018-March, pp. 391-401). [8330226] Institute of Electrical and Electronics Engineers Inc.. https://doi.org/10.1109/SANER.2018.8330226