HTML vs Clone

Benchmark created on


Preparation HTML

<div id="hello">
  <p>
    Hello World
  </p>
  <p>
    Hello World
  </p>
  <p>
    Hello World
  </p>
  <p>
    Hello World
  </p>
  <p>
    Hello World
  </p>
  <p>
    Hello World
  </p>
  <p>
    Hello World
  </p>
  <p>
    Hello World
  </p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
  var $body = $('body');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
HTML
$body.append($('#hello').html());
ready
Clone
$body.append($('#hello').clone(true, true));
ready
innerHTML
$body.append($('#hello').get(0).innerHTML);
ready

Revisions

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