append vs appendChild (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
append
const node = document.createElement("div");
for (let i = 0; i < 100; i++) {
	document.querySelector("#container").append(node.cloneNode(true));
}
ready
appendChild
const node = document.createElement("div");
for (let i = 0; i < 100; i++) {
	document.querySelector("#container").appendChild(node.cloneNode(true));
}
ready

Revisions

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