论文标题

用于识别和ELIDE多余的JavaScript代码的系统,用于更快的网页加载

System to Identify and Elide Superfluous JavaScript Code for Faster Webpage Loads

论文作者

Goel, Utkarsh, Steiner, Moritz

论文摘要

许多网站导入大型JavaScript(JS)库来自定义和增强用户体验。我们的数据表明,许多JS库仅在页面加载期间部分使用,因此包含从未执行的多余代码。许多排名最高的网站包含多达数百千千字节的压缩多余代码和中间页面上的JS资源包含31%的多余代码。多余的JS代码夸大了页面的重量,从而是时候下载,解析和编译JS资源的时间。因此,重要的是监视使用情况并优化JS资源的有效载荷以提高Web性能。但是,鉴于网页的设计和功能可能取决于用户的首选项或设备,在许多其他因素中,在受控环境中积极加载网页不能涵盖所有可能的条件,在哪些可能会更改网页内容和功能的情况下。在本文中,我们表明被动测量技术,例如真实的用户监视系统(RUM),可以利用在不同条件下进行真实用户页面加载的性能以识别多余的代码。使用自定义的中型代理(类似于内容交付网络的代理服务器),我们为网站开发人员设计了一种系统的方法,该方法依赖于真实用户加载的页面来被动地识别JS资源上的多余代码。然后,在随后的页面加载请求之前,我们会从JS资源中使用任何多余的代码。我们的数据表明,Eliving多余的JS代码将中间的页面加载时间提高了5%,长尾巴中的页面至少提高了10%。通过本文提出的结果,我们激励需要严格监控在不同现实世界条件下使用JS资源的使用,以提高网络性能。

Many websites import large JavaScript (JS) libraries to customize and enhance user experiences. Our data shows that many JS libraries are only partially utilized during a page load, and therefore, contain superfluous code that is never executed. Many top-ranked websites contain up to hundreds of kilobytes of compressed superfluous code and a JS resource on a median page contains 31% superfluous code. Superfluous JS code inflates the page weight, and thereby, the time to download, parse, and compile a JS resource. It is therefore important to monitor the usage and optimize the payload of JS resources to improve Web performance. However, given that the webpage design and functionality could depend on a user's preferences or device, among many other factors, actively loading webpages in controlled environments cannot cover all possible conditions in which webpage content and functionality changes. In this paper, we show that passive measurement techniques, such as real user monitoring systems (RUM), that monitor the performance of real user page loads under different conditions can be leveraged to identify superfluous code. Using a custom man-in-the-middle proxy (similar to a content delivery network's proxy server), we designed a systematic approach for website developers that relies on pages loaded by real users to passively identify superfluous code on JS resources. We then elide any superfluous code from JS resources before subsequent page load requests. Our data shows that eliding superfluous JS code improves the median page load time by 5% and by at least 10% for pages in the long tail. Through results presented in this paper, we motivate for the need for rigorous monitoring of the usage of JS resources under different real world conditions, with the goal to improve Web performance.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源