innerHTML-vs-createElement (v2)

Revision 2 of this benchmark created on


Preparation HTML

<div id="container"></div>
<script>
  var container = document.getElementById('container');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
innerHTML
(function() {
 container.innerHTML = '<div>';
})();
ready
createElement
(function() {
 container.appendChild(document.createElement('div'));
})();
ready

Revisions

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