为什么 JQuery 需要快

发布于 2024-11-09 00:40:35 字数 149 浏览 0 评论 0原文

我已经搜索过 SO 上的 JQuery 标签。我看过很多与 JQuery 速度有关的帖子。我使用 JQuery 已经大约一年了,从未遇到过任何速度问题。在所有性能改进之前,我什至使用过以前版本的 JQuery,并且从未见过任何速度问题。我想问一下人们使用JQuery 是为了追求速度?

I have searched through the JQuery tag on SO. I have seen many posts that are concerned with JQuerys speed. I have been working with JQuery for about a year now and never experienced any speed issues. I even worked with previous versions of JQuery before all the performance improvements and I never saw any speed issues. I would like to ask what do people use JQuery for to need speed?

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

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

发布评论

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

评论(4

我想说动画是 JQuery 需要高性能的事情之一。

I would say animations is one of the things JQuery needs to be performant for.

得不到的就毁灭 2024-11-16 00:40:35

因为 jQuery 已经成为事实上的标准 DOM 操作库。

每个人都关心速度增益。人们开始越来越多地推动浏览器的发展,大量渲染工作在客户端完成。

为了获得交互式、流畅的用户体验,它需要足够快。

我想问一下人们使用 JQuery 来做什么需要速度?

  • 客户端模板。仅通过线路发送 JSON 数据并完全通过 JavaScript
  • 移动浏览呈现页面。移动设备比台式机慢很多。因此,它只需要高效、快速即可获得良好的用户体验。

主要问题之一是人们只是编写低效的 jQuery 代码并期望它很快。人们也不再为了速度而进行原始 DOM 操作,并期望 jQuery 也能同样快。

Because jQuery has become the de factor standard DOM manipulation library.

And everyone cares about speed gains. People are starting to push the browsers more and more with a lot of rendering being done on the client.

For an interactive, fluid, user experience it needs to be fast.

I would like to ask what do people use JQuery for to need speed?

  • Client side templating. Sending only JSON data over the wire and rendering the page entirely through JavaScript
  • Mobile browsing. Mobile devices are a lot slower then desktops. So it simply needs to be efficient and fast for a good user experience.

One of the main issues is that people are simply writing inefficient jQuery code and expecting it to be fast. People have also stopped doing raw DOM manipulation for speed and are expecting jQuery to be just as fast.

一指流沙 2024-11-16 00:40:35

当然,这并不是每个人的情况,但许多开发人员希望允许使用性能较差的设备(例如智能手机、上网本和旧电脑)的用户看到他们的网站完美无缺。因此,在这种情况下,速度很重要,并且保留它永远不会有坏处;)

Well, of course it's not everyone's case, but many developers would like to allow users with less capable devices (such as smartphones, netbooks and old computers) to see their website flawlessy. So speed is something important in this case, and it never hurts preserving it ;)

痴意少年 2024-11-16 00:40:35

这取决于您使用什么来衡量速度 - 移动设备和不寻常客户端(例如电视内置浏览器)上的设备可能无法高速渲染。

我相信 JQuery 最近的动画改进之一是使用 requestAnimationFrame (http://paulirish.com/2011/requestanimationframe-for-smart-animating/),这有利于减少不必要的 CPU 周期,从而延长电池寿命: )。

随着 JavaScript 库现在如此流行,大多数进步对整个 Web 都是有利的

It depends what you're using to benchmark your speed - mobile devices and those on unusual clients such as browsers built into TVs are likely to be much less capable of rendering at high speed.

I believe one of the recent animation improvements in JQuery now is to use requestAnimationFrame (http://paulirish.com/2011/requestanimationframe-for-smart-animating/) which is good for reducing needless CPU cycles and thus increases your battery life :).

With JavaScript libraries being so popular now, most progress is good for the web as a whole

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