Skip to main content

Waiter and AUTRATAC: Don’t Throw It Away, Just Delay!

  • Conference paper
  • First Online:
Web Engineering (ICWE 2023)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    web.dev/fcp.

  2. 2.

    developer.mozilla.org/en−US/docs/Web/JavaScript/Reference/Global_Objects/eval.

  3. 3.

    tranco-list.eu.

  4. 4.

    create-react-app.dev.

  5. 5.

    developer.apple.com/download/more/?q=Additional%20Tools.

  6. 6.

    npmjs.com/package/network-link-conditioner.

References

  1. Archive, H.: HTTP archive: state of JavaScript (2022). https://httparchive.org/reports/state-of-javascript. Accessed 9 Jan 2022

  2. waiter-and autratac: TestPages (2023). https://github.com/waiter-and-autratac/TestPages. Accessed 31 Jan 2023

  3. babeljs.io: Babel - the compiler for next generation JavaScript (2022). https://babeljs.io. Accessed 10 Jan 2022

  4. 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)

    Google Scholar 

  5. contributors, M.: Promise - JavaScript MDN (2022). https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise Accessed 9 Jan 2022

  6. estree: estree (2022). https://github.com/estree/estree. Accessed 10 Jan 2022

  7. Goel, U., Steiner, M.: System to identify and elide superfluous JavaScript code for faster webpage loads. arXiv preprint arXiv:2003.07396 (2020)

  8. Google: Closure Compiler - Google Developers (2020). https://developers.google.com/closure/compiler Accessed 15 Jan 2022

  9. 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)

  10. 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

  11. 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)

    Article  Google Scholar 

  12. Nielsen, J.: Website response times. Nielsen Norman Group (2010)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. 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

  15. 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

  16. waiter-and-autratac: Waiter and AUTRATAC (2023). https://github.com/waiter-and-autratac/WaiterAndAUTRATAC. Accessed 31 Jan 2023

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lucas Vogel .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics