您的位置 首页 > 腾讯云社区

识别和消除多余JavaScript代码以加快网页加载速度的系统(CS NI)---Elva

许多网站导入大型JavaScript(JS)库来定制和增强用户体验。我们的数据显示,许多JS库只在页面加载期间部分使用,因此包含了从未执行过的多余代码。许多排名靠前的网站包含多达数百数千字节的压缩多余代码,而中间页面上的JS资源包含31%的多余代码。多余的JS代码会增加页面的权重,从而增加下载、解析和编译JS资源的时间。因此,监控JS资源的使用和优化JS资源的负载对于提高网络性能非常重要。然而,考虑到网页设计和功能可能取决于用户的偏好或设备,以及许多其他因素,在受控环境中主动加载网页无法涵盖网页内容和功能更改的所有可能情况。在本文中,我们展示了被动测量技术,例如真实用户监视系统(RUM),可以用来监视不同条件下真实用户页面加载的性能,以识别多余的代码。我们使用一个定制的中间人代理(类似于内容交付网络的代理服务器)为网站开发人员设计了一个系统化的方法来根据真实用户加载的页面被动地识别JS资源上多余的代码。然后,在后续的页面加载请求之前,我们从JS资源中删除任何多余的代码。我们的数据表明,省略多余的JS代码可以将页面加载时间中位数提高5%,对于长尾页面,至少可以提高10%。通过本文给出的结果,我们激发了在不同的现实环境下对JS资源使用情况进行严格监控的需求,以期提高网络性能。

原文题目:System to Identify and Elide Superfluous JavaScript Code for Faster Webpage Loads

原文: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.

原文作者:Utkarsh Goel, Moritz Steiner

原文地址:https://arxiv.org/abs/2003.07396

识别和消除多余JavaScript代码以加快网页加载速度的系统(CS NI).pdf ---来自腾讯云社区的---Elva

关于作者: 瞎采新闻

这里可以显示个人介绍!这里可以显示个人介绍!

热门文章

留言与评论(共有 0 条评论)
   
验证码: