Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have been using JQuery for quite sometime now and I'm pretty much happy with the performance.

I'm just wondering if there is any performance comparison between jQuery, YUI, Dojo, Prototype, Mootools etc.? What are all the advantages of using jQuery framework over others?

share|improve this question

closed as not constructive by Jim G., gnat, Kilian Foth, Bart van Ingen Schenau, Dynamic Jun 12 '13 at 12:45

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

8  
Don't you dare question jQuery! –  ChaosPandion Feb 20 '11 at 17:48
6  
Nothing, you should totally drop using it and use jQuery instead. –  Ivo Wetzel Feb 20 '11 at 17:56
6  
@IvoWetzel Actually I think that jQuery is overkill here, so he should totally drop it and use jQuery instead. –  Raynos Feb 20 '11 at 17:58
1  
@Raynos Indeed, but one of the main advantages of jQuery would be that JavaScript was written in it, that definitely makes the few things (read: 1.675) that jQuery doesn't handle easier. –  Ivo Wetzel Feb 20 '11 at 18:00
1  
@IvoWetzel I forgot that the JavaScript engine runs on jQuery. Yeah so what ever your doing, your always running on jQuery. –  Raynos Feb 20 '11 at 18:02
add comment

6 Answers

All in all I see many correct answers here, however, rather than just reference performance inquiries, or just look for features, I have another theory.

A few things to consider (as I did beforeofficially setting jQuery as the Lib I use at work and home):

  1. Industry standards: Simply put, what is going to be the most versatile among multiple platforms as well as, what looks like it will continue to grow with the industry.
    • In my opinion this more important than any other factor as this will help determine both the life of your web-app/sight and the extensability
    • It's been my find (through personal research, not gonna list the things I looked at and did as it would get lengthy) that jQuery best meets these qualifications, however, you might look at what you want your sight/app to do and see how those features are used on multiple platforms to best determine if this is the same measure for yourself.
  2. Almost forget(edited in) SECURITY!!! I didn't see too many people mention this, but something to think about. For instance, Prototype tends to be faster than jQuery, especially in ajax calls, however, this is because jQuery does MUCH more behind the seens to ensure the "security" of you ajax call as well as giving you all the tools you need to set these securities manually, where as Prototype does very little behind the scene work and expects you to use their class system to create your own security measures on ajax calls. This is the definitive number 2 thing to look for in js libs as js hacks are some of the most widely used at this time!
  3. In my personal opinion, feature richness is just slightly ahead of performance, because, while a lib may lack in performance, what it offers in features will (if it's a good lib) continually be updated to improve its performance. Thus making feature richness more important.
    • as a sub-conclusion here, also look at ease of use in these features. One thing I tend to like about jQuery over some of the others is its repetitive use in "styleing" of the code. They are very forcful with how plugins are writtin for their lib thus making everything easily importable and useful in that I dont have to learn new mark up to understand a plugin. This is VERY important to me.
    • [Edit-2/14] As another note, don't be too "impressed" with features, as that too can get you in trouble. My example, jQueryUI vs all other UI extension libs for jQuery. Some people jump on those other jQuery UI Libs because they offer more complete, "all-in-one" features, but soon find themselves stuck in a pickle. I like that jQueryUI is limited in its features, as they only include what may be absolutely necessary to start, leaving you to "plugin" anything else you might need.
  4. Finally, performance, performance is important, however, as mentioned before, many lacking items of performance can be made up for by an easy to use mark up combined with feature-richness combined with proven growth. Alot of recent(3yrs old still, but compares alot of known types) information about performance can be found here.

All in all, these are just my opinions, but some things to consider when deciding on a new change in code. One last thing I didn't mention, how easy will it be to convert your code? If you've already used jQuery for a while, then you've prolly already made so much use of its "easy" features, that, at this point, a code change could set you back weeks or even months. My personal suggestion would be to "go with what you know" but at the same time, to maybe, as a side project, study something else you are interested in until you have a grasp enough on it to make that final decision and possible change.

share|improve this answer
add comment

jQuery.x() is better then jQuery.y() but x is usable in condition a and y() is usable more in condition B.

If you tried to use Y() in condition A then it will make less performance. You can write your own code which will work perfect.

jQuery code run other function inside their framework. You never can expect them to run very well. If you want really solid performance then tried to use your own code without jQuery.

All javascript framework never give better performance then others in Every function they implemented in framework so they never compare them. if you want to performance comparison between jQuery 's it's own version then you should read jQuery blog to know about them.
share|improve this answer
    
Lies! jQuery is faster! –  Raynos Feb 20 '11 at 18:02
1  
Wanna rephrase that? –  James Love Feb 20 '11 at 18:32
add comment

For your review:

If it's possible, build a set of atomic tasks that are common in your applications. Model each task in the frameworks you're interested in and benchmark. Benchmarks are notoriously finicky so you're better off benchmarking your exact use cases.

One seldom uttered advantage to jQuery is John Resig. He's a real role model, very appealing in so many ways. His taste is impeccable.

share|improve this answer
1  
Wow, an actual answer (of some kind) to the performance question. Almost missed it in the sea of irrelevant-commentary and/or jQuery-zealotry-joke answers :) –  MGOwen Feb 21 '11 at 1:49
add comment

This is kind of like asking if cars are faster than trucks. These libraries are made up of dozens or hundreds of methods. I expect you will find that each library is faster for some activities, slower in others, and the same on quite a few.

All in all, I'd decide on a library based on features not performance.

share|improve this answer
    
IMO one should chose a framework based on the performance and not with the features they offer. If there are performance issues there is no point in adding features :) –  Peter Feb 21 '11 at 16:58
    
Counter-point: If it doesn't have the features you want, who cares how fast it is? –  JohnFx Feb 21 '11 at 17:14
add comment

I think you would also want to consider what other frameworks you might be working in and what libraries they leverage. For example, WordPress already relies quite heavily on jQuery, already loads the library, and has some built-in interoperability functions in PHP that facilitate uitlizing jQuery within your own WordPress-based development. On the other hand, Joomla bundles MooTools, so if you're working in that environment, you're better off leveraging that library instead (particularly since both libraries hijack '$' so you have to do some namespacing protection if you're going to use them both).

Otherwise, you need to balance: 1. benchmark performance 2. feature set 3. developer community and plugin / resource availability 4. API ease of use 5. documentation

Not necessarily in that order.

Based on that, MooTools and jQuery stand out for me as the two major contenders, with MooTools possibly winning out on performance and jQuery on resources.

share|improve this answer
add comment

From a performance perspective I don't think there is a lot of difference (gut feeling)

From a usage perspective it is what you are used to and you can learn any of them (although for jQuery the number of resources seems larger)

The big difference for me at the moment is how much Microsoft is pushing. Microsoft supplies jQuery with their visual studio distributions, gives support and contributes to jQuery.

share|improve this answer
    
the fact that microsoft is backing jQuery is great phrase to through at your management in corporate companies when they say "You can't use 3rd party OS libraries!". –  Raynos Feb 21 '11 at 7:45
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.