9

I've just been looking through the Mootools documentation and it seems to do everything jQuery does with loads of extra features. Incredibly, it all fits into less space than jQuery does.

I've always been under the impression that Mootools is lighter and faster at DOM manipulation, etc than jQuery, so I'm thinking of writing my next heavily JavaScript-ised site with Mootools to keep things fast.

This leads me on to my question: is Mootools noticeably faster for intensive JavaScript applications than jQuery, or am I being silly and forgetting about what Donald Knuth likes to say?

As an aside, if this question is deemed to broad or may be flagged for removal, could you please leave a comment and I will remove this post by myself. Thanks.

Bojangles
  • 99,427
  • 50
  • 170
  • 208
  • Flagged for removal as subjective (or not constructive which is the new close vote reason). – Darin Dimitrov Jul 09 '11 at 19:11
  • I'd be interested in a link on what "Donald Knuth likes to say" – Chase Florell Jul 09 '11 at 19:12
  • 4
    I'm not sure if this is "not constructive". I'd be interested in seeing some benchmarks on JQuery vs Mootools performance. – Chase Florell Jul 09 '11 at 19:13
  • @rockin: His most famous quote is `Premature optimisation is the root of all evil`, which is what I was referring to :-) – Bojangles Jul 09 '11 at 19:16
  • ah yes, I have heard this, just didn't know who it came from. – Chase Florell Jul 09 '11 at 19:18
  • A huge point of consideration is the speed differences of the javascript engines employed in the various browsers [as seen here.](http://www.tomshardware.com/reviews/opera-firefox-chrome,2976-6.html) That being said, jquery enjoys a robust community, and that counts for a lot. I like the more OO approach that mootools takes, but its community is not nearly as active. More important than raw speed? hard to say - but its worth considering. – Bosworth99 Jul 09 '11 at 19:21
  • I've had a lot of experience with jQuery, so I think I could learn Mootools almost entirely from the docs which is why the lack of a huge community doesn't bother me too much. – Bojangles Jul 09 '11 at 19:31

4 Answers4

3

Thats akin to asking about a performance comparisson between go carts and f1 cars without saying where you'd drive them. If all you care about is DOM perf, then jquery (the go-cart) will be more suited and faster in getting things done. Mootools is somewhat more complex and advanced.

It's also down to the driver skills. Failing to understand performance implications of building an application and failing to follow best practices in doing so will make your library choice irrelevant. Does not matter what car is parked outside your house if you can't drive, does it?

So I voted to close this. It's too ambiguous a subject and there is no single correct answer.

For my 2 cents, I would never use jquery, given a choice. Selector speed is nearly identical these days which means you ought to pick based on other considerations, like scalability and features, support, plugins and available technical know-how, costs to each. There is no clear winner, ever.

Dimitar Christoff
  • 26,147
  • 8
  • 50
  • 69
  • I see your argument for the close vote, and even agree. I also agree on the fact that Mootools is more advanced - I've just been reading up on the OO side of Mootools and it looks very promising. – Bojangles Jul 09 '11 at 19:56
  • totally . Mootools changed my life ;) the OO side of it is awesome but also the api choices made sense. It feels like javascript. Mootools 2.0 will be different but we shall see – Dimitar Christoff Jul 09 '11 at 20:04
1

Well, as already said, there may no real comparision exist, as there are two different things with different goals.

The fact they overlap is a border effect...

So you will certainly find some applications faster with one but you will surely find other applications faster with the other... ( My belive: widely used application will be faster with jquery, when more conceptual would be simplier and even faster with mootools. But it's only a feeling! ;-)

The more exact answer to your ask if found there: JqueryVsMootools.com/#mottos where it's suggested to read the title or introduction to the description of each library:

JQuery:

Query is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development

Mootools:

MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.

Post scriptum:

As this kind of question was already closed many times on SO, I think this could be a good thing to let this open...

F. Hauri - Give Up GitHub
  • 64,122
  • 17
  • 116
  • 137
1

You can find out for yourself with slickspeed but I don't know how much you can trust this :)

Generally, I would say it's a matter of taste.

Here are some results from 2009, but the picture may have changed.

Minified code also brings performance improvements, dojo is great for minifying you entire JS code. Also, dojo 1.6 now adds this (taken from here):

A follow-up on Eugene's answer: In addition to the massive infrastructure it provides, Dojo 1.6 is also the first (and only) popular JavaScript Library that can be successfully used with the Closure Compiler's Advanced mode, with all the size, performance and obfuscation benefits attached to it -- other than Google's own Closure Library, that is.

http://dojo-toolkit.33424.n3.nabble.com/file/n2636749/Using_the_Dojo_Toolkit_with_the_Closure_Compiler.pdf?by-user=t

Community
  • 1
  • 1
emboss
  • 38,880
  • 7
  • 101
  • 108
0

Interesting article here : jQuery vs Mootools

Speed tests 1 Speed tests 2

Phil
  • 10,948
  • 17
  • 69
  • 101
  • 2
    I don't think those comparisons are remotely interesting. They are horrendously out of date. 1.2.6 was released *3 years ago*. 1.4.2 is 18 months ago. – lonesomeday Jul 09 '11 at 19:17
  • Bit old considering jQuery 1.6 is out but good comparison nevertheless. – adarshr Jul 09 '11 at 19:17
  • 2
    Take a look at Slickspeed now with reasonably recent versions of all the libraries and have a look: http://mootools.net/slickspeed/ – Bojangles Jul 09 '11 at 19:40