Closure window.jQuery vs jQuery

JavaScript performance comparison

Revision 2 of this test case created by Tomás

Preparation code

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
window.jQuery
(function($){
  $(document.body);
}(window.jQuery));
pending…
jQuery
(function($){
   $(document.body);
}(jQuery));
pending…
window.jQuery & window.document
(function($, document){
  $(document.body);
}(window.jQuery, window.document));
pending…
jQuery & document
(function($, document){
  $(document.body);
}(jQuery, document));
pending…
jQuery & document & location
(function($, document, location){
  $(document.body);
}(jQuery, document, location));
pending…
jQuery & document & location & window
(function($, document, location, window){
  $(document.body);
}(jQuery, document, location, window));
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment