clone vs. template (v10)

Revision 10 of this benchmark created on


Preparation HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

Setup

var template_short = "<div class='tabLegendItem'><span class='tabLegendItemSwatchHolder'></span><span class='tabLegendItemLabelHolder'><span class='tabLegendItemLabel' /></span></div>";
  var clone_template = $(template_short);
  var html = $(document.body);

Test runner

Ready to run.

Testing in
TestOps/sec
clone
html.append(clone_template.clone());
$(".test").remove();
ready
template
html.append(template_short);
$(".test").remove();
ready

Revisions

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