<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
</head>
<body>
<script>
var Table = document.body.appendChild(document.createElement('table')), time = performance.now();
for(var i = 0; i < 1000; i++) {
var row=Table.insertRow(i);
for(var j=0; j< 1000; j++) {
var cell=row.insertCell(j);
cell.appendChild(document.createTextNode([i,j]));
}
}
alert(performance.now() - time);
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
</head>
<body>
<script>
var Table = document.body.appendChild(document.createElement('table')), time = performance.now();
for(var i = 0; i < 1000; i++) {
var row= document.createElement('tr');
for(var j=0; j< 1000; j++) {
var cell= document.createElement('td');
cell.appendChild(document.createTextNode([i,j]));
row.appendChild(cell)
}
Table.appendChild(row)
}
alert(performance.now() - time);
</script>
</body>
</html>