svetlo (v3)

Revision 3 of this benchmark created by Vladimir Carrer on


Preparation HTML

<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('p'));
  
  var b = document.querySelectorAll('p');
  
  var c = document.getElementsByTagName('p');
  
  var d = document.querySelectorAll.call(document, 'p');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Svetlo - Selector Engine
for (var i = 0, length = a.length; i < length; i++) {
 a[i].nodeName;
}
ready
Native querySelectorAll
for (var i = 0, length = b.length; i < length; i++) {
 b[i].nodeName;
}
ready
Native getElementsByTagName
for (var i = 0, length = c.length; i < length; i++) {
 c[i].nodeName;
}
ready
QSA - Selector Engine
for (var i = 0, length = d.length; i < length; i++) {
 d[i].nodeName;
}
ready

Revisions

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

  • Revision 3: published by Vladimir Carrer on