clone vs. template (v15)

Revision 15 of this benchmark created on


Preparation HTML

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

Setup

var template_short = "<div class='test'>text</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($(clone_template));
$(".test").remove();
ready

Revisions

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