JS Library Performance - Selection
JavaScript performance comparison
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://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.
| Test | Ops/sec | |
|---|---|---|
ID -jqMobi |
|
pending… |
ID - jQuery 1.7.1 |
|
pending… |
ID - jQuery 2.0b |
|
pending… |
ID - getElementById |
|
pending… |
Nested Class - jqMobi |
|
pending… |
Nested Class - jQuery 1.7.1 |
|
pending… |
Nested Class - jQuery 2.0b |
|
pending… |
Nested Class - querySelectorAll |
|
pending… |
Attr Selection - jqMobi |
|
pending… |
Attr Selection - jQuery 1.7.1 |
|
pending… |
Attr Selection - jQuery 2.0.0b |
|
pending… |
Attr Selection - querySelectorAll |
|
pending… |
Nested Class - querySelector.querySelectorAll |
|
pending… |
Nested Class - getElementById.querySelectorAll |
|
pending… |
Attr Selection - querySelectorAll .class |
|
pending… |
Attr Selection - getElementsByClassName |
|
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:
- Revision 1: published by Jack Pattishall and last updated
- Revision 2: published by Jim Montgomery
0 comments