Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Chrome 105
Windows
Desktop
2 years ago
Test name Executions per second
append 479331.4 Ops/sec
appendChild 570250.2 Ops/sec
HTML Preparation code:
AخA
 
1
<div id="container"></div>
Script Preparation code:
 
var container = document.getElementById("container");
var paragraph = document.createElement("p");
var paragraph1 = document.createElement("p");
var paragraph2 = document.createElement("p");
var paragraph3 = document.createElement("p");
Tests:
  • append

     
    container.append(paragraph,paragraph1,paragraph2,paragraph3);
  • appendChild

     
    container.appendChild(paragraph);
    container.appendChild(paragraph1);
    container.appendChild(paragraph2);
    container.appendChild(paragraph3);