jquery clone with true

Benchmark created by dunaicapa on


Description

check the speed it takes to copy the attributes

Preparation HTML

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

<div id="testDiv" class="divClass">
<div class="dummyDiv"><span>blah blah blah</span></div>
<h1>elementToSlowItDown</h1>
</div>

<div id="container"></div>
 
<script>
  var testDiv = $("#testDiv").detach();
  var container = $("#container");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
without
container.append(testDiv.clone());
ready
with
container.append(testDiv.clone(true));
ready

Revisions

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

  • Revision 1: published by dunaicapa on