Abstract
The modern web is built with a mixture of HTML, CSS, and an increasing amount of JavaScript. Since JavaScript determines \(\approx \)70% of the overall data of websites on average, JavaScript code efficiency significantly influences their loading performance. A recent study revealed that the average JavaScript code usage until render is \(\approx \)40%. For economical and convenience reasons, a significant amount of research already focuses on optimizing the delivered data to reduce loading times. For example, a large area of research focuses on eliminating dead code, where unused functions are deleted. Code in this context is classified as “dead” when the results of the code or the whole code itself are never executed or used. Since code elimination is based on heuristics/code classification, there is always a trade-off between code elimination and missing JavaScript code that harms the correct functioning of the website. As a result, some pages do not load correctly after elimination. Even the most advanced attempts with user input emulation do not achieve 100% accuracy. In this paper, we introduce two new open-source frameworks called Waiter, which waits until a resource is available, and AUTRATAC, an automatic transpiler to awaitable code. Both can be used separately or in combination to robustly delay pieces of JavaScript code without breaking it. For example, it allows code to be executed without loading all called functions beforehand. Therefore, when eliminating dead code optimized with AUTRATAC, the loading of unused functions can be delayed in a non-render-blocking way. This also opens up multiple new opportunities, as future code-splitting techniques might be significantly stricter without breaking a page. Our results show that delaying render-blocking JavaScript reduces loading times until First Contentful Paint (FCP) significantly, especially at slower network speeds. In one instance, an 85% drop in loading time was measured. Furthermore, it was visible that deferring the code with the developed frameworks still matches the total code execution time of the original render-blocking JavaScript.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
- 4.
- 5.
developer.apple.com/download/more/?q=Additional%20Tools.
- 6.
References
Archive, H.: HTTP archive: state of JavaScript (2022). https://httparchive.org/reports/state-of-javascript. Accessed 9 Jan 2022
waiter-and autratac: TestPages (2023). https://github.com/waiter-and-autratac/TestPages. Accessed 31 Jan 2023
babeljs.io: Babel - the compiler for next generation JavaScript (2022). https://babeljs.io. Accessed 10 Jan 2022
Chaqfeh, M., Zaki, Y., Hu, J., Subramanian, L.: JSCleaner: de-cluttering mobile webpages through JavaScript cleanup. In: Proceedings of the Web Conference 2020, pp. 763–773 (2020)
contributors, M.: Promise - JavaScript MDN (2022). https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Accessed 9 Jan 2022
estree: estree (2022). https://github.com/estree/estree. Accessed 10 Jan 2022
Goel, U., Steiner, M.: System to identify and elide superfluous JavaScript code for faster webpage loads. arXiv preprint arXiv:2003.07396 (2020)
Google: Closure Compiler - Google Developers (2020). https://developers.google.com/closure/compiler Accessed 15 Jan 2022
Kupoluyi, T., Chaqfeh, M., Varvello, M., Hashmi, W., Subramanian, L., Zaki, Y.: Muzeel: a dynamic javascript analyzer for dead code elimination in today’s web. arXiv preprint arXiv:2106.08948 (2021)
Linden, G.: Slides from my talk at Stanford (2022). http://glinden.blogspot.com/2006/12/slides-from-my-talk-at-stanford.html. Accessed 9 Jan 2022
Nah, F.F.H.: A study on tolerable waiting time: how long are web users willing to wait? Behav. Inf. Technol. 23(3), 153–163 (2004)
Nielsen, J.: Website response times. Nielsen Norman Group (2010)
Reiser, M., Bläser, L.: Accelerate JavaScript applications by cross-compiling to WebAssembly. In: Proceedings of the 9th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages, pp. 10–17 (2017)
statista.com: most used web frameworks among developers 2022 \(\vert \) Statista (2022). https://www.statista.com/statistics/1124699/worldwide-developer-survey-most-used-frameworks-web. Accessed 5 Sep 2022
Vogel, L., Springer, T.: An in-depth analysis of web page structure and efficiency with focus on optimization potential for initial page load. In: Di Noia, T., Ko, I.Y., Schedl, M., Ardito, C. (eds.) Web Engineering. ICWE 2022. LNCS, vol. 13362, pp. 101–116. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-09917-5_7
waiter-and-autratac: Waiter and AUTRATAC (2023). https://github.com/waiter-and-autratac/WaiterAndAUTRATAC. Accessed 31 Jan 2023
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Vogel, L., Springer, T. (2023). Waiter and AUTRATAC: Don’t Throw It Away, Just Delay!. In: Garrigós, I., Murillo Rodríguez, J.M., Wimmer, M. (eds) Web Engineering. ICWE 2023. Lecture Notes in Computer Science, vol 13893. Springer, Cham. https://doi.org/10.1007/978-3-031-34444-2_20
Download citation
DOI: https://doi.org/10.1007/978-3-031-34444-2_20
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-34443-5
Online ISBN: 978-3-031-34444-2
eBook Packages: Computer ScienceComputer Science (R0)