innerHTML vs removeChild (v577)

Revision 577 of this benchmark created by Oleg Nechaev on


Preparation HTML

<div id='box'></div>

Setup

var box = document.getElementById('box');
  box.innerHTML = 'sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>'

Teardown



            box.innerHTML = 'sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>s f</b>s df<p>df gsdfg sf g<b>'
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
removeChild
while (box.firstChild) {
  box.removeChild(box.firstChild);
}
ready
textContent
box.textContent = "" ;
ready
innerHTML
box.innerHTML = '';
ready
removeLastChild
while (box.lastChild) {
  box.removeChild(box.lastChild);
}
ready
.remove
while (box.firstChild) {
  box.firstChild.remove();
}
ready

Revisions

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