Browser Diet - jQuery Selectors
JavaScript performance comparison
Preparation code
<div>
<ul id="list">
<li class="test"></li>
<li></li>
<li class="test"></li>
<li></li>
<li class="test"></li>
<li></li>
<li class="test"></li>
<li></li>
<li class="test"></li>
</ul>
</div>
<div class="test"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
var list = document.getElementById('list');
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
context |
|
pending… |
selector |
|
pending… |
context and find() |
|
pending… |
created context |
|
pending… |
selector and find |
|
pending… |
parent/child selector |
|
pending… |
immediate children |
|
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 Zeno Rocha
- Revision 2: published by trajektorijus
- Revision 3: published
- Revision 4: published
- Revision 5: published
- Revision 6: published
- Revision 7: published by Scott
- Revision 8: published by Stephen
- Revision 9: published
- Revision 10: published
- Revision 11: published
0 comments