div#some_id vs #some_id

Benchmark created by Beat Richartz on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div class="heyhey">
  <div class="hoho">
    <div class="other">
    <span class="span"></span>
    </div>
  </div>
  <div class="heyhey">
  <div class="hoho">
    <div class="other">
    <span class="span"></span>
    </div>
  </div>
</div>
</div>
    <div id="some_id">
    <span class="span"></span>
    </div>

Test runner

Ready to run.

Testing in
TestOps/sec
div#some_id
$('div#some_id')
ready
#some_id
$('#some_id')
ready

Revisions

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

  • Revision 1: published by Beat Richartz on