Jquery single vs nested description

Benchmark created by Kalina on


Preparation HTML

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

<div class="doesntmatter classForToggle">
<div id="id">
<div class="doesntmatter2">Hoho</div>
<div id="id_inner"></div>
<p>Hoho</p>
</div>

<div>

Test runner

Ready to run.

Testing in
TestOps/sec
Nested selector
$(function() {
  $("#id p");
});
 
ready
simple selector
$(function() {
  $("p");
});
ready

Revisions

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