Tests:
  • CloneNode

    x
     
    const row = '<tr><td>1</td><td>2</td></tr>';
    const table = '<table><tbody>' + Array(10000).fill(row).join('') + '</tbody></table>';
    const template = document.createElement('template');
    template.innerHTML = table;
    const div = document.createElement('div');
    template.content.firstChild.cloneNode(true);
  • InnerHTML

     
    const row = '<tr><td>1</td><td>2</td></tr>';
    const table = '<table><tbody>' + Array(10000).fill(row).join('') + '</tbody></table>';
    const template = document.createElement('template');
    template.innerHTML = table;
    const div = document.createElement('div');
    div.innerHTML = table;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    CloneNode
    InnerHTML

    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
CloneNode 50.2 Ops/sec
InnerHTML 30.5 Ops/sec