Script Preparation code:
x
 
function template(html) {
  var t = document.createElement('template');
  t.innerHTML = html;
  return t.content.firstChild;
}
function div(html) {
  var t = document.createElement('div');
  t.innerHTML = html;
  return t.firstChild;
}
var html = '<div><div class="col-md-1"></div><div class="col-md-4"><a></a></div><div class="col-md-1"><a><span class="glyphicon glyphicon-remove" aria-hidden="true" /></a></div><div class="col-md-6" /></div>';
Tests:
  • Template

     
    template(html).cloneNode(true);
  • Div

     
    div(html).cloneNode(true);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Template
    Div

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
Chrome 102 on Linux
View result in a separate tab
Test name Executions per second
Template 96019.2 Ops/sec
Div 95163.6 Ops/sec