JavaScript 对网页整体性能的影响

发布于 2024-11-06 00:55:20 字数 214 浏览 0 评论 0原文

在网络上使用 JavaScript 随机获取一个网页。有没有关于 JavaScript 在全局加载/执行时间中所占份额的数据? 我的意思是,如果这个份额接近 0%,那么优化 JavaScript 解释器就没有任何好处,众所周知,你可以通过快速解释器赚一些钱:) 我猜像 Google 和 Mozilla 这样的公司有这样的数字,但我找不到它们。

有人可以给我指一些数字吗?

提前致谢

Take a random web page with JavaScript on the web. Are there any numbers on what the share of JavaScript is on the global load/execution time?
I mean, if that share would be close to 0%, there would be no benefit in optimizing the JavaScript interpreter, nut as we all know, you can make some money with a fast interpreter :)
I guess companies like Google and Mozilla have such numbers, but I couldn't find them.

Can someone point me to some numbers?

thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

燕归巢 2024-11-13 00:55:20

性能:分析不同网站如何使用浏览器子系统

将它们整合在一起

要构建快速的现实世界浏览器,您必须了解不同的浏览器子系统如何影响现实世界场景中的性能,并且必须关注重要的子系统。

对于 AJAX 网站,这意味着专注于渲染 (31%)、JavaScript (21%) 、格式 (14%) 和布局 (12%)。对于新闻网站,这意味着关注 JavaScript (29%)、编组 (18%) 和 渲染17%)。

分析新闻网站

分析新闻网站

分析新闻站点2

分析顶级 AJAX 站点

分析热门 AJAX 站点

Performance: Profiling how different web sites use browser subsystems

Bringing It All Together

To build a fast real world browser you have to understand how different browser subsystems impact performance in real world scenarios, and you have to focus on the subsystems that matter.

For AJAX sites, that means focusing on Rendering (31%), JavaScript (21%), Formatting (14%) and Layout (12%). For news sites, that means focusing on JavaScript (29%), Marshalling (18%) and Rendering (17%).

Profiling News Sites

Profiling News Sites

Profiling News Sites2

Profiling Top AJAX Sites

Profiling Top AJAX Sites

晚风撩人 2024-11-13 00:55:20

对于大多数网页,JavaScript 仅在初始“准备”过程中增加极少量的执行时间。事实上,它甚至可以在图像等下载之前完成执行。所以,是的,JavaScript 对整体初始加载/执行时间的影响通常接近于零。

我没有你想要的数字,但如果我有,我认为它们会表明 JavaScript 的执行速度并不重要。

但这很重要。初始加载/执行时间并不是全部。

过去,提高网页速度的关键在于缩短输入 URL 与页面呈现并可供使用之间的时间。是的,JavaScript 对这一小段时间(在大多数网站上)并没有产生重大影响,因此浏览器供应商并没有太担心它。 JavaScript 引擎非常慢,但这并不重要。

现在,越来越多的网页正在成为富客户端应用程序,页面随着用户的点击和移动而变化,而这一切都是由 JavaScript 处理的。对于这样的应用程序,更快的 JS 引擎可以让整个体验感觉更快,而不仅仅是初始加载。普遍的共识是,这种趋势将会持续下去;许多人预测,在大多数任务中,Web 应用程序将比桌面应用程序更受欢迎。

这就是为什么浏览器供应商现在在 JavaScript 引擎上如此努力,以更快地处理当今的 JS 密集型 Web 应用程序(以及明天的 JS 密集型 Web 应用程序)。但这是一种你无法轻易用秒来衡量的“更快”。

For most web pages, the JavaScript adds only a tiny amount of execution time to the initial "getting ready" process. In fact, it can complete its execution before images etc. have even downloaded. So yes, the impact of JavaScript on the overall initial load/execution time is often close to zero.

I don't have the numbers you're asking for, but if I did, I think they would indicate that JavaScript execution speed isn't important.

But it is important. Initial load/execution time isn't the whole story.

In the past, making web pages faster was all about reducing the time between the moment you enter the URL and the moment the page is rendered and ready to use. And yes, JavaScript doesn't have a major impact on this little piece of time (on most websites), and thus the browser vendors didn't worry about it too much. JavaScript engines were extremely slow, and it didn't matter much.

Now, more and more web pages are becoming rich client-side applications, with the page changing in response to the user's clicks and movements, and all this is handled by JavaScript. With applications like these, a faster JS engine makes the whole experience feel faster, not just the initial load. And the general consensus is that this trend will continue; many predict that web applications will become more popular than desktop applications for most tasks.

That's why the browser vendors are now working so hard on their JavaScript engines – to handle today's JS-heavy web apps (and tomorrow's even-more-JS-heavy web apps) faster. But it's a kind of "faster" that you can't easily measure in seconds.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文