arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2106.08948cs.SE
收藏

Muzeel:一个动态的JavaScript分析器,用于消除当今Web中的死代码

Muzeel: A Dynamic JavaScript Analyzer for Dead Code Elimination in Today's Web

Tofunmi Kupoluyi, Moumena Chaqfeh, Matteo Varvello, Waleed Hashmi, Lakshmi Subramanian, Yasir Zaki

摘要:

JavaScript导致了当今Web的复杂性不断增加。为了支持用户交互并加快开发周期,Web开发人员严重依赖大型通用第三方JavaScript库。这种做法增加了网页的大小和处理复杂性,因为它带来了网页不使用但浏览器不必要地下载和处理的附加功能。在本文中,对大约40,000个网页的分析表明,中值页面上70%的JavaScript函数未被使用,消除这些函数将有助于将页面大小减少60%。受这些发现的启发,我们提出了Muzeel(在阿拉伯语中的意思是消除器);一种消除给定网页中不使用的JavaScript函数(通常称为死代码)的解决方案。Muzeel在页面加载时提取所有页面事件侦听器,并使用触发每个事件的bot来模拟用户交互,以消除这些事件中任何一个都没有调用的函数的死代码。我们在多个Android手机和浏览器上的评测结果显示,Muzeel在低端手机上的页面加载速度提升了30%左右,在3G网络下的高端手机上提升了25%。它还将低端和高端手机在相同网络下的速度指数(这是一个重要的用户体验指标)分别降低了23%和21%。此外,Muzeel减少了整体下载大小,同时保持了页面的视觉内容和交互功能。

英文摘要:

JavaScript contributes to the increasing complexity of today's web. To support user interactivity and accelerate the development cycle, web developers heavily rely on large general-purpose third-party JavaScript libraries. This practice increases the size and the processing complexity of a web page by bringing additional functions that are not used by the page but unnecessarily downloaded and processed by the browser. In this paper, an analysis of around 40,000 web pages shows that 70% of JavaScript functions on the median page are unused, and the elimination of these functions would contribute to the reduction of the page size by 60%. Motivated by these findings, we propose Muzeel (which means eliminator in Arabic); a solution for eliminating JavaScript functions that are not used in a given web page (commonly referred to as dead code). Muzeel extracts all of the page event listeners upon page load, and emulates user interactions using a bot that triggers each of these events, in order to eliminate the dead code of functions that are not called by any of these events. Our evaluation results spanning several Android mobile phones and browsers show that Muzeel speeds up the page load by around 30% on low-end phones, and by 25% on high-end phones under 3G network. It also reduces the speed index (which is an important user experience metric) by 23% and 21% under the same network on low-end, and high-end phones, respectively. Additionally, Muzeel reduces the overall download size while maintaining the visual content and interactive functionality of the pages.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑