Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In terms of speed: jQuery or Mootools [closed]

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.

like image 419
Bojangles Avatar asked Jul 09 '11 19:07

Bojangles


2 Answers

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.

like image 82
Dimitar Christoff Avatar answered Oct 06 '22 12:10

Dimitar Christoff


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

like image 45
emboss Avatar answered Oct 06 '22 12:10

emboss