DOM Manipulation

Benchmark created on


Preparation HTML

<div id="test"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
Appending Div
const div = document.getElementById("test")

for(let i = 10000; i > 0; i--){
	const newDiv = document.createElement("div");
	div.appendChild(newDiv);
}



ready
String Concatenation
let elms = '';
for(let i = 10000; i > 0; i--){
	elms += '<div></div>';
}

const div = document.getElementById("test")
div.innerHtml = elms;
ready

Revisions

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