querySelectoAll performance

JavaScript performance comparison

Test case created

Preparation code

<div>
  <ul id="list">
    <li class="test">
    </li>
    <li>
    </li>
    <li class="test">
    </li>
    <li class="test">
    </li>
    <li>
    </li>
    <li class="test">
    </li>
    <li>
    </li>
    <li class="test">
    </li>
    <li>
    </li>
    <li class="test">
    </li>
  </ul>
</div>
<div class="test">
</div>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
at once
document.querySelectorAll('#list .test');
pending…
at twice
document.querySelectorAll('#list')[0].querySelectorAll('.test');
pending…
getElementById+querySelectorAll
document.getElementById('list').querySelectorAll('.text');
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