Test name | Executions per second |
---|---|
Template | 47166.5 Ops/sec |
Div | 60763.9 Ops/sec |
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 = '<tr><td class="col-md-1"></td><td class="col-md-4"><a></a></td><td class="col-md-1"><a><span class="glyphicon glyphicon-remove" aria-hidden="true" /></a></td><td class="col-md-6" /></tr>';
template(html).cloneNode(true);
div(html).cloneNode(true);