Script Preparation code:
x
 
box1 = document.createElement("div");
box2 = document.createElement("div");
box2.src = "https://google.com";
box2.setAttribute('style', 'position:absolute;display:block;width:300px;hright:300px;border:2px solid blue');
box2.textContent = "X";
Tests:
  • innerHTML

     
    for (var i=0; i<100;i++){
    box1.innerHTML += box2.outerHTML;
    }
  • insertAdjacentHTML

     
    for (var i=0; i<100;i++){
    box1.insertAdjacentHTML('beforeend', box2.outerHTML);
    }
  • appendChild

     
    for (var i=0; i<100;i++){
    let El = document.createElement("div");
    El.src="https://google.com";
    El.setAttribute('style','position:absolute;display:block;width:300px;hright:300px;border:2px solid blue');
    El.textContent = "X";
    box1.appendChild(El);
    }
  • insertAdjacentElement

     
    for (var i=0; i<100;i++){
    let El = document.createElement("div");
    El.src = "https://google.com";
    El.setAttribute('style', 'position:absolute;display:block;width:300px;hright:300px;border:2px solid blue');
    El.textContent = "X";
    box1.insertAdjacentElement('beforeend', El);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    innerHTML
    insertAdjacentHTML
    appendChild
    insertAdjacentElement

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0
Firefox 133 on Linux
View result in a separate tab
Test name Executions per second
innerHTML 2.6 Ops/sec
insertAdjacentHTML 1672.4 Ops/sec
appendChild 2385.0 Ops/sec
insertAdjacentElement 2429.6 Ops/sec