paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Increasing the Responsiveness of Web Applications by Introducing Lazy Loading

通过引入懒加载提升 Web 应用响应性
ASE 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE)2023匹配度 3/10 · 论文属于程序分析与代码变换方向,与用户对静态分析/编译的宽泛兴趣有一定交集,但不涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析等核心追踪问题,因此匹配度较低。引用 7 inbox
Alexi Turcotte, Satyajit Gokhale, Frank Tip
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出静态分析与代码变换方法,自动为 JavaScript 应用引入第三方包懒加载,减少初始体积和加载时间。

前端 JavaScript 应用常因大量复用第三方包而体积膨胀,降低页面响应速度。虽然 2020 年加入的异步动态 import 支持按需懒加载外部包,但现有项目迁移需要复杂且非局部的代码改写。本文提出自动引入第三方包懒加载的方法:用静态分析识别可被懒加载的外部件,并生成相应代码变换;由于静态分析不完备,这些变换作为建议供程序员审查和测试。作者实现工具 Lazifier,在 10 个开源前端 JavaScript 应用上评估。所有应用均被成功重构,平均初始体积减少 36.2%,初始加载时间减少 29.7%,且未出现不完备性问题。

问题
前端 JavaScript 应用因第三方包依赖而体积膨胀,初始加载和响应变慢;手动迁移到动态 import 实现懒加载需要复杂且非局部的代码改写。
方法
通过静态分析识别可被懒加载的第三方包,并自动生成相应的代码变换;由于分析不完备,变换以建议形式供程序员审查和测试。
评估
在 10 个开源前端 JavaScript 应用上实现并评估工具 Lazifier,所有应用均成功重构,平均初始体积降低 36.2%、加载时间降低 29.7%,未观察到不完备性问题。
原文摘要(Abstract)

Front-end developers want their applications to contain no more code than is needed in order to minimize the amount of time that elapses between visiting a web page and the page becoming responsive. However, front-end code is typically written in JavaScript, the ubiquitous “language of the web”, and tends to rely heavily on third-party packages. While the reuse of packages improves developer productivity, it is notorious for resulting in very large “bloated” applications, resulting in a degraded end-user experience. One way to combat such bloat is to lazily load external packages on an as-needed basis, for which support was added to JavaScript in 2020 when asynchronous, dynamic imports were added to the language standard. Unfortunately, migrating existing projects to take advantage of this feature is nontrivial, as the code changes required to introduce asynchrony may involve complex, non-local transformations. In this work, we propose an approach for automatically introducing lazy loading of third-party packages in JavaScript applications. Our approach relies on static analysis to identify external packages that can be loaded lazily and generates the code transformations required to lazily load those packages. Since the static analysis is unsound, these transformations are presented as suggestions that programmers should review and test carefully. We implement this approach in a tool called Lazifier, and evaluate Lazifier on 10 open-source front-end JavaScript applications, showing that each application was successfully refactored, reducing initial application size and load times in all cases. On average, for these applications, Lazifier reduces initial application size by 36.2 %, initial load time by 29.7 %, and unsoundness did not arise in any of these applications.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{TurcotteGT23,
  title = {Increasing the Responsiveness of Web Applications by Introducing Lazy Loading},
  author = {Alexi Turcotte and Satyajit Gokhale and Frank Tip},
  booktitle = {ASE},
  year = {2023},
  doi = {10.1109/ase56229.2023.00192}
}