remove vs fragment

Benchmark created on


Setup

let html = ""
for (let i = 0; i < 100; i++) { 
	html += '<div style="height: 10px;"></div>'
}
document.body.innerHTML = html

Test runner

Ready to run.

Testing in
TestOps/sec
remove
[...document.body.children].forEach(item => item.remove())
ready
fragment
new DocumentFragment().append(...document.body.children)
ready

Revisions

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