jquery selector speed
JavaScript performance comparison
Preparation code
<div id="container">
<ul>
<li>1</li>
<li class="target">2</li>
<li>3</li>
</ul>
</div><script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Preparation code output
- 1
- 2
- 3
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
$('div#container ul li.target') |
|
pending… |
$('#container .target') |
|
pending… |
$('li.target') |
|
pending… |
$('.target') |
|
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 AlienWebguy
- Revision 2: published
- Revision 3: published
- Revision 4: published
- Revision 5: published
- Revision 6: published
- Revision 7: published
- Revision 8: published
- Revision 9: published
- Revision 10: published
- Revision 11: published
- Revision 13: published
- Revision 14: published
- Revision 16: published
- Revision 17: published
- Revision 18: published by Jordan
- Revision 19: published
- Revision 20: published by Ryan Graham
- Revision 21: published
- Revision 22: published by SkeLLLa
- Revision 23: published by SkeLLLa
- Revision 24: published by sb
- Revision 25: published by Tony
- Revision 27: published
- Revision 28: published by Guhe Louis
- Revision 29: published
- Revision 30: published by Paul Grenier
- Revision 32: published
- Revision 33: published
- Revision 34: published
- Revision 35: published
- Revision 36: published
- Revision 37: published
- Revision 40: published
- Revision 41: published by Tom Taylor
- Revision 43: published by Jérôme Tamarelle
0 comments