innerHTML vs insertAdjacentHtml multiple children

Benchmark created by Will Busby on


Preparation HTML

<div id="parent"></div>

Setup

var parent = document.getElementById('parent');

Test runner

Ready to run.

Testing in
TestOps/sec
innerHTML
parent.innerHTML += '<span>test</span>';
ready
insertAdjacentHtml
parent.insertAdjacentHTML('beforeend', '<span>test</span>');
ready

Revisions

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

  • Revision 1: published by Will Busby on