minimize jQuery object creation
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="appRoot">
<div class="element1">
element1
<p class="el_p">
additional tag
<span class="el_s">
and another
</span>
</p>
</div>
<div class="element2">
element2
<p class="el_p">
additional tag
<span class="el_s">
and another
</span>
</p>
</div>
<div class="element3">
element3
<p class="el_p">
additional tag
<span class="el_s">
and another
</span>
</p>
</div>
<div class="element4">
element4
<p class="el_p">
additional tag
<span class="el_s">
and another
</span>
</p>
</div>
<div class="element5">
element5
<p class="el_p">
additional tag
<span class="el_s">
and another
</span>
</p>
</div>
<div class="element6">
element6
<p class="el_p">
additional tag
<span class="el_s">
and another
</span>
</p>
</div>
</div>
Preparation code output
element1
additional tag and another
element2
additional tag and another
element3
additional tag and another
element4
additional tag and another
element5
additional tag and another
element6
additional tag and another
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
More jQuery objects |
|
pending… |
Less jQuery Objects |
|
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 adardesign
- Revision 2: published
- Revision 3: published
- Revision 4: published
- Revision 5: published
- Revision 6: published
- Revision 7: published
- Revision 9: published
- Revision 10: published
- Revision 11: published by adardesign
- Revision 13: published
0 comments