jQuery 1.3 与 1.4(性能)

发布于 2024-08-18 19:33:24 字数 348 浏览 5 评论 0原文

jQuery 1.4 最近发布,新网站显示了一些性能图表,其中 1.4 显然更好,但是有人已经对 1.4 与 1.3 的整体性能改进进行了分析吗?如果没有,我如何在我的网站/页面上对两者进行配置,是否有任何工具?

迫不及待地想知道 1.4 与以前的版本相比有多快。

编辑:一位博主做了一些测试,发现在 FF 中快约 30%,但在 Safari 中慢(与 1.3 相比)。唔...

jQuery 1.4 released recently and the new website shows some performance charts where 1.4 is clearly better, but has someone already done an analysis of overall performance improvement of 1.4 vs 1.3? If not, how do I profile both on my sites/pages, are there any tools?

Can't wait to find out how fast is 1.4 compared to the previous version.

Edit: A blogger did some tests and found that its about 30% faster in FF but slower (compared to 1.3) in Safari. Hmm...

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

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

发布评论

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

评论(4

几度春秋 2024-08-25 19:33:24

他们的图表只展示了故事的一方面。我最近一直在编写一个脚本,该脚本涉及迭代整个 DOM 树中的数千个输入元素并遍历它们的父元素。根据 Firebug 的说法,在确切的 js 和 DOM 结构上,jQuery 1.4 的运行速度比 1.3.2 慢大约 30%。

这并不是说 1.4 总体上并不“更快”,而且这只是在我所介绍的一种浏览器中。我认为这一次他们的努力更多地集中在加速与动态内容创建相关的领域,而不是而不是处理现有的静态元素。

只是想我还应该指出这些图表列出了函数调用的数量,而不是执行时间。较少的函数调用并不总是意味着较短的执行时间。在我的情况下,1.4 执行的调用减少了大约 20%,但运行速度慢了大约 30%。

Their diagrams only show one side of the story. I've recently been working on a script that involves iterating over thousands of input elements throughout the DOM tree and traversing their parent elements. According to Firebug, jQuery 1.4 runs roughly 30% slower that 1.3.2 on the exact js and DOM structure.

That's not to say that 1.4 isn't "faster" in general though, and this is only in one browser I've profiled in. I think that this time their efforts where more focused on speeding up areas that related to dynamic content creation rather than dealing with existing static elements.

Just thought I should also point that those charts list the number of function calls, not the execution time. Fewer function calls doesn't always translate to lower execution time. In my situation 1.4 executes about 20% fewer calls but runs about 30% slower.

烟凡古楼 2024-08-25 19:33:24

This report says that jQuery have massive performance improvements in 1.4

http://www.stevesouders.com/blog/2010/01/15/jquery-14-performance/

著墨染雨君画夕 2024-08-25 19:33:24

嗯.. 在我为一个项目更新了 jQuery(具有广泛的 DOM 操作)后,我注意到整体性能有所提高。所以我猜这些报告是真实的(或者非常接近现实)

Well.. After I updated jQuery for a project (with extensive DOM manipulation), I noticed an overall performance improvement. So I guess those reports are for real (or pretty close to the reality)

两仪 2024-08-25 19:33:24

有一个关于 jQuery 团队的性能改进的官方页面,也许这是一个好的开始: http://jquery14.com/day-01/jquery-14#backwards

There is an official page about the performance improvements from the jQuery team, perhaps this is a good start: http://jquery14.com/day-01/jquery-14#backwards

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