Why does JQuery need to be fast
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开发者_JS百科 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?
I would say animations is one of the things JQuery needs to be performant for.
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.
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 ;)
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
精彩评论