Why does JQuery need to be fast

时间:2021-10-11 04:07:11

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?

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

4 个解决方案

#1


3  

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

我想说动画是JQuery需要具备的功能之一。

#2


3  

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

因为jQuery已成为de factor标准DOM操作库。

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?

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

  • Client side templating. Sending only JSON data over the wire and rendering the page entirely through JavaScript
  • 客户端模板。仅通过线路发送JSON数据并完全通过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.

其中一个主要问题是人们只是编写低效的jQuery代码并期望它快速。人们也停止了对速度进行原始DOM操作,并期望jQuery同样快。

#3


2  

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 ;)

嗯,当然不是每个人的情况,但许多开发人员希望允许功能较弱的设备(如智能手机,上网本和旧电脑)的用户看到他们的网站完美无瑕。因此速度在这种情况下是重要的,它永远不会伤害保留它;)

#4


0  

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 :).

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

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

随着JavaScript库现在如此受欢迎,大多数进展对整个网络都有好处

#1


3  

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

我想说动画是JQuery需要具备的功能之一。

#2


3  

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

因为jQuery已成为de factor标准DOM操作库。

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?

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

  • Client side templating. Sending only JSON data over the wire and rendering the page entirely through JavaScript
  • 客户端模板。仅通过线路发送JSON数据并完全通过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.

其中一个主要问题是人们只是编写低效的jQuery代码并期望它快速。人们也停止了对速度进行原始DOM操作,并期望jQuery同样快。

#3


2  

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 ;)

嗯,当然不是每个人的情况,但许多开发人员希望允许功能较弱的设备(如智能手机,上网本和旧电脑)的用户看到他们的网站完美无瑕。因此速度在这种情况下是重要的,它永远不会伤害保留它;)

#4


0  

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 :).

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

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

随着JavaScript库现在如此受欢迎,大多数进展对整个网络都有好处