clone vs. template (v11)

Revision 11 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='tab-tiledViewer placeholder'>" +
     "<div class='tab-clip'>" +
       "<div class='tab-tvTLSpacer tvMobileRegion'><img></img></div>" +
       "<div class='tab-tvTRSpacer tvMobileRegion'><img></img></div>" +
       "<div class='tab-tvBLSpacer tvMobileRegion'><img></img></div>" +
       "<div class='tab-tvBRSpacer tvMobileRegion'><img></img></div>" +
       "<div class='tab-tvYLabel tvMobileRegion'><div class='tvMScrollContainer'>" +
         "<div class='tvMScrolledNode'><div class='tvimagesContainer'></div></div></div></div>" +
       "<div class='tab-tvLeftAxis tvMobileRegion'><div class='tvMScrollContainer'>" +
         "<div class='tvMScrolledNode'><div class='tvimagesContainer'></div></div></div></div>" +
       "<div class='tab-tvRightAxis tvMobileRegion'><div class='tvMScrollContainer'>" +
         "<div class='tvMScrolledNode'><div class='tvimagesContainer'></div></div></div></div>" +
       "<div class='tab-tvXLabel tvMobileRegion'><div class='tvMScrollContainer'>" +
         "<div class='tvMScrolledNode'><div class='tvimagesContainer'></div></div></div></div>" +
       "<div class='tab-tvBottomAxis tvMobileRegion'><div class='tvMScrollContainer'>" +
         "<div class='tvMScrolledNode'><div class='tvimagesContainer'></div></div></div></div>" +
       "<div class='tab-tvTopAxis tvMobileRegion'><div class='tvMScrollContainer'>" +
         "<div class='tvMScrolledNode'><div class='tvimagesContainer'></div></div></div></div>" +
       "<div class='tab-tvView tvMobileRegion'>" +
         "<div class='tvMScrollContainer'>" +
           "<div class='tvMScrolledNode'>" +
             "<div class='tvBackgroundContainer'></div>" +
             "<div class='tvimagesContainer'></div>" + 
           "</div>" + 
          "<div class='tvViewportBorders'></div>" + 
         "</div>" + 
       "</div>" + 
       "<div class='tab-tvTitle tvMobileRegion'></div>" + 
       "<div class='tab-tvCaption tvMobileRegion'></div>" + 
     "</div>" + 
  "</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.