HTML Preparation code:
AخA
 
1
<section id="container"></section>
Tests:
  • appendChild to fragment, then append after getElementById (with cloneNode)

    x
     
    let fragment = document.createDocumentFragment();
    let elem = document.createElement("div");
    for (let i = 0; i < 100; i++) {
      fragment.appendChild(elem);
      elem = elem.cloneNode();
    }
    let container = document.getElementById("container");
    container.appendChild(elem)
  • appendChild to fragment, then append after createElement (with cloneNode)

     
    let fragment = document.createDocumentFragment();
    let elem = document.createElement("div");
    for (let i = 0; i < 100; i++) {
      fragment.appendChild(elem);
      elem = elem.cloneNode();
    }
    let container = document.createElement("section");
    container.appendChild(elem)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    appendChild to fragment, then append after getElementById (with cloneNode)
    appendChild to fragment, then append after createElement (with cloneNode)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91 on Mac OS X 10.15
View result in a separate tab
Test name Executions per second
appendChild to fragment, then append after getElementById (with cloneNode) 16487.8 Ops/sec
appendChild to fragment, then append after createElement (with cloneNode) 14868.2 Ops/sec