svetlo-id
JavaScript performance comparison
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.
| Test | Ops/sec | |
|---|---|---|
Svetlo - Selector Engine (ID) |
|
pending… |
Native querySelectorAll |
|
pending… |
Native getElementById |
|
pending… |
QSA - Selector Engine(core) |
|
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