HTML Preparation code:
AخA
 
1
<table id="tbl">
2
  <tbody></tbody>
3
</table>
Script Preparation code:
x
 
var tbody = tbl.tBodies[0];
var data = { one: 'one', two: 'two', three: 'three', four: 'four', five: 'five' };
Tests:
  • insertRow()

     
        var row = tbl.insertRow();
        var cell = row.insertCell();
        var textnode = document.createTextNode(data.one);
        cell.appendChild(textnode);
        cell = row.insertCell();
        textnode = document.createTextNode(data.two);
        cell.appendChild(textnode);
        cell = row.insertCell();
        textnode = document.createTextNode(data.three);
        cell.appendChild(textnode);
        cell = row.insertCell();
        textnode = document.createTextNode(data.four);
        cell.appendChild(textnode);
        cell = row.insertCell();
        textnode = document.createTextNode(data.five);
        cell.appendChild(textnode);
  • insertAdjacentHTML()

     
        var html = '<tr>';
        html += '<td>'+data.one+'</td>';
        html += '<td>'+data.two+'</td>';
        html += '<td>'+data.three+'</td>';
        html += '<td>'+data.four+'</td>';
        html += '<td>'+data.five+'</td>';
        html += '</tr>';
        tbody.insertAdjacentHTML('beforeend', html);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    insertRow()
    insertAdjacentHTML()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109 on Windows
View result in a separate tab
Test name Executions per second
insertRow() 65856.8 Ops/sec
insertAdjacentHTML() 57502.6 Ops/sec