HTML Preparation code:
AخA
 
1
<div id="container"></div>
Script Preparation code:
 
var container = document.getElementById('container');
var fragment = document.createDocumentFragment();
for (let i = 0; i < 1000; i++) {
  const li = document.createElement('li');
  li.textContent = `Item ${i}`;
  fragment.appendChild(li);
}
var elements = [];
for (let i = 0; i < 1000; i++) {
  const li = document.createElement('li');
  li.textContent = `Item ${i}`;
  elements.push(li)
}
Tests:
  • appendChild fragment

     
    container.appendChild(fragment)
  • appendChildren

     
    container.append(...elements)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    appendChild fragment
    appendChildren

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 9 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Chrome 127 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
appendChild fragment 9502907.0 Ops/sec
appendChildren 3244.1 Ops/sec