$(document).ready test

JavaScript performance comparison

Test case created

Preparation code

<script src="//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
1 document ready
$(document).ready(function() {
  for (var i = 0; i < 100; i++) {
    console.log('document ready test');
  };
});
pending…
multiple document ready
for (var i = 0; i < 100; i++) {
  $(document).ready(function() {
    console.log('document ready test');
  });
};
pending…
local var
var doc = $(document);
for (var i = 0; i < 100; i++) {
  doc.ready(function() {
    console.log('document ready test');
  });
};
pending…
local var and custom event
var doc = $(document);
for (var i = 0; i < 100; i++) {
 doc.bind("go",function() {
    console.log('document ready test');
  });
};

doc.ready(function() {  doc.trigger("go"); });
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment