append vs appendChild (v3)

Revision 3 of this benchmark created on


Preparation HTML

<div id="container"></div>

Setup

const node1 = document.createElement("div");
const node2 = document.createElement("div");
const node3 = document.createElement("div");
const node4 = document.createElement("div");
const container = document.querySelector("#container");

Test runner

Ready to run.

Testing in
TestOps/sec
append
container.append(node1);
container.append(node2);
container.append(node3);
container.append(node4);
ready
appendChild
container.appendChild(node1);
container.appendChild(node2);
container.appendChild(node3);
container.appendChild(node4);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.