id_tags

JavaScript performance comparison

Revision 39 of this test case created by jayli

Preparation code

<div id="a">
<p class="test">Foo</p>
<p class="test">Baz</p>
<p class="test">Bar</p>
<p class="test">Foo</p>
<p class="test">Baz</p>
<p class="test">Bar</p>
<p class="test">Foo</p>
<p class="test">Baz</p>
<p class="test">Bar</p>


</div>
<script src="http://a.tbcdn.cn/s/kissy/1.3.0/kissy-min.js"></script>
<script src="http://zeptojs.com/zepto.min.js"></script>
    

Preparation code output

<div id="a"> <p class="test">Foo</p> <p class="test">Baz</p> <p class="test">Bar</p> <p class="test">Foo</p> <p class="test">Baz</p> <p class="test">Bar</p> <p class="test">Foo</p> <p class="test">Baz</p> <p class="test">Bar</p> </div>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
KISSY.all
var bar = KISSY.all('#a p');
pending…
KISSY链式调用
var bar = KISSY.one('#a').all('p');
pending…
querySelector
var bar = document.querySelectorAll("#a p");
pending…
链式querySelector+getByTagName
var bar = document.querySelector("#a").getElementsByTagName("p");
pending…
链式getElementById+getByTagName
var bar = document.getElementById("a").getElementsByTagName("p");
pending…
Zepto
var bar = $('#a p');
pending…
链式Zepto
var bar = $('#a').find('p');
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.

0 Comments

Foo

Baz

Bar

Foo

Baz

Bar

Foo

Baz

Bar