jQuery Simple Selector
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>var jq142 = jQuery.noConflict();</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>var jq144 = jQuery.noConflict();</script>
<script src="//code.jquery.com/jquery-git.js?asdf"></script>
<script>var jq15 = jQuery.noConflict();</script>
<div class="test" id="test">
<script>
var html = "";
for ( var i = 0; i < 500; i++ ) {
html += '<div class="find"></div>';
}
document.write( html );
</script>
</div>
<script>
var $jq142 = jq142("body");
var $jq144 = jq144("body");
var $jq15 = jq15("body");
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Class 1.4.2 |
|
pending… |
Class 1.4.4 |
|
pending… |
Class 1.5 |
|
pending… |
Tag 1.4.2 |
|
pending… |
Tag 1.4.4 |
|
pending… |
Tag 1.5 |
|
pending… |
Document ID 1.4.2 |
|
pending… |
Document ID 1.4.4 |
|
pending… |
Document ID 1.5 |
|
pending… |
Body 1.4.2 |
|
pending… |
Body 1.4.4 |
|
pending… |
Body 1.5 |
|
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 John Resig and last updated
- Revision 2: published
- Revision 4: published
- Revision 16: published by Eric Heydenberk
- Revision 17: published
- Revision 18: published
- Revision 19: published by dogada
- Revision 20: published
- Revision 23: published
0 comments