svetlo-class

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('.world'));
  
  var b = document.querySelectorAll('.world');
  
  var c = document.querySelectorAll.call(document, '.world');
</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
QSA - Selector Engine
for (var i = 0, length = c.length; i < length; i++) {
 c[i].nodeName;
}
ready

Revisions

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

  • Revision 1: published by Vladimir Carrer on