jQuery body vs. document.body selector

JavaScript performance comparison

Revision 41 of this test case created by Protosterone

Preparation code

Thanks on your marvelous posting! I genuinely enjoyed reading it, you can be a great 
author. I will make certain to bookmark your blog and may come 
back very soon. I want to encourage continue your great 
job, have a nice day!
      
<script>
Benchmark.prototype.setup = function() {
  PAYS DE LA LOIRE

};

Benchmark.prototype.teardown = function() {
  PAYS DE LA LOIRE

};
</script>

Preparation code output

Thanks on your marvelous posting! I genuinely enjoyed reading it, you can be a great author. I will make certain to bookmark your blog and may come back very soon. I want to encourage continue your great job, have a nice day!

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
$(document.body)
Thanks on your marvelous posting! I genuinely enjoyed reading it, you can be a great author.
I will make certain to bookmark your blog and may come back very soon. I want to 
encourage continue your great job, have a 
nice day!
pending…
$('body')
Thanks on your marvelous posting! I genuinely enjoyed reading it, you can be a great author.
I will make certain to bookmark your blog and 
may come back very soon. I want to encourage continue your great job, have a nice day!
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.

0 Comments

Thanks on your marvelous posting! I genuinely enjoyed reading it, you can be a great author. I will make certain to bookmark your blog and may come back very soon. I want to encourage continue your great job, have a nice day!