JS Library Performance - Selection

JavaScript performance comparison

Test case created by Jack Pattishall and last updated

Preparation code

<script src='http://code.jquery.com/jquery-1.7.1.min.js'></script>
<script>
jq17 = jQuery.noConflict();
</script>
<script src="http://code.jquery.com/jquery-2.0.0b1.js"></script>
<script>
jq20 = jQuery.noConflict();
</script>
<script src="http://zeptojs.com/zepto.min.js"></script>
<script src="http://cdn.jqmobi.com/jq.mobi.min.js"></script>

<div class='tests'>
  <div id='selection_test' class='test'></div>
  <div id='selection_test_nested' class='test'>
    <div class='attr_selection'></div>
    <div id='selection_test_nested_child'></div>
  </div>
</div>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
ID -jqMobi
jq('#selection_test');
pending…
ID - jQuery 1.7.1
jq17('#selection_test');
pending…
ID - jQuery 2.0b
jq20('#selection_test');
 
pending…
ID - Zepto
Zepto('#selection_test');
pending…
Nested Class - jqMobi
jq('#selection_test .test');
pending…
Nested Class - jQuery 1.7.1
jq17('#selection_test .test');
pending…
Nested Class - jQuery 2.0b
jq20('#selection_test .test');
pending…
Nested Class - Zepto
Zepto('#selection_test .test');
pending…
Attr Selection - jqMobi
jq("[class='attr_selection']")
 
pending…
Attr Selection - jQuery 1.7.1
jq17("[class='attr_selection']")
 
pending…
Attr Selection - jQuery 2.0.0b
jq20("[class='attr_selection']")
pending…
Attr Selection - Zepto
Zepto("[class='attr_selection']")
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