jQuery 1.6.1 .add() Performance - With and Without Cached jQuery Objectes (v8)

Revision 8 of this benchmark created on


Description

comparing add speed using cached and new selections

Preparation HTML

<script src="http://code.jquery.com/jquery-1.3.1.js"></script>
<script>var jq131 = jQuery.noConflict();</script>
<script src="http://code.jquery.com/jquery-1.4.2.js"></script>
<script>var jq142 = jQuery.noConflict();</script>
<script src="http://code.jquery.com/jquery-1.6.js"></script>
<script>var jq16 = jQuery.noConflict();</script>
<script src="http://code.jquery.com/jquery-1.6.1.js"></script>
<script>var jq161 = jQuery.noConflict();</script>
<script src="http://code.jquery.com/jquery-git.js"></script>
<script>var jqgit = jQuery.noConflict();</script>
<div style="display:none;">
<ul>
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
<div>
<span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span>
</div>
</div>
<script>
  var spansFor161 = jq161("span");
  var lisFor161 = jq161("li");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
1.6.1 cached.add(select)
var newobj = spansFor161.add("li")
ready
1.6.1 cached.add(cached)
var newobj = spansFor161.add(lisFor161)
ready
1.6.1 select.add(select)
var newobj = jq161("span").add("li")
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.