test=function(fu, i){
console.time(fu.name)
while(i--){fu()}
console.timeEnd(fu.name)
}
function first(j){
var table = document.createElement('table')
var tr = table.appendChild(document.createElement('tbody')).appendChild(document.createElement('tr'));
for (var i = 1; i < j; i++) {
tr.appendChild(document.createElement('td'));
}
table1=table
}
function second(j){
var table = document.createElement('table')
var tr = table.insertRow();
for (var i = 1; i < j; i++) {
tr.insertCell();
}
table2=table
}
function third(j){
var table = document.createElement('table')
var str=""
for (var i = 1; i < j; i++) {
str+="<td></td>"
}
table.innerHTML=str
table3=table
}
i=1
j=10000
test(function frst(){first(j)}, i)
test(function scd(){second(j)}, i)
test(function thd(){third(j)}, i)
document.body.appendChild(table1)
document.body.appendChild(table2)
document.body.appendChild(table3)