Append VS prepend (v7)

Revision 7 of this benchmark created on


Description

Improved by removing differences in test.

Previous iterations did not clear DOM before test and inserted different strings.

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="target"></div>

Setup

var target = $("#target");
    var string = "<span>string</span>";
    
    console.log(target);

Teardown


    target.html("");
  

Test runner

Ready to run.

Testing in
TestOps/sec
Append
target.append(string);
ready
Prepend
target.prepend(string);
ready

Revisions

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