Individual vs Batch jQuery insertion (v8)

Revision 8 of this benchmark created by Pavithra on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div id="fixture" hidden></div>

<script>
var nyanImg = '<img width="40px" src="http://i1.kym-cdn.com/photos/images/original/000/117/424/tumblr_ljwaimhJcK1qa4ebfo1_500.gif" />';
</script>

Setup

var fixture = $("#fixture");
    
    fixture.empty();

Test runner

Ready to run.

Testing in
TestOps/sec
Single insertion
// Times 10
for(var i=0;i<10;i++){
fixture.append(nyanImg);
}
ready
Batch insertion
// Batch of 10
var batch = $(new Array(11).join(nyanImg));
fixture.append(batch);
ready

Revisions

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

  • Revision 2: published by henrahmagix on
  • Revision 4: published by Benjaminbenben on
  • Revision 5: published by Rick Waldron on
  • Revision 6: published by Jon Raasch on
  • Revision 8: published by Pavithra on
  • Revision 9: published on
  • Revision 10: published on