svetlo-id

JavaScript performance comparison

Revision 3 of this test case created by Vladimir Carrer

Preparation code

<div id="test">
<p>a</p><p>a</p><p>a</p><p>a</p><p class="hello">a</p><p>a</p><p class="world">a</p><p>a</p><p>a</p><p>a</p><p>a</p>
</div>
<script>
  var a = Array.prototype.slice.call(document.querySelectorAll('#test'));
 
  var b = document.querySelectorAll('#test');
 
  var c = document.getElementById('test');
 
  var d = document.querySelectorAll.call(document, '#test');
</script>

Preparation code output

a

a

a

a

a

a

a

a

a

a

a

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Svetlo - Selector Engine (ID)
a[0].nodeName;
pending…
Native querySelectorAll
b[0].nodeName;
pending…
Native getElementById
c.nodeName;
pending…
QSA - Selector Engine(core)
d[0].nodeName;
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. Here’s a list of current revisions for this page:

0 comments

Add a comment