insertAdjacentHTML

Benchmark created on


Preparation HTML

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

Setup

while (work.hasChildNodes()){
   work.removeChild(work.firstChild);
  }

Test runner

Ready to run.

Testing in
TestOps/sec
insertAdjacentHTML
work.insertAdjacentHTML("BeforeEnd", "<span>test</span>");
ready
innerHTML
work.innerHTML += "<span>test</span>";
ready
appendChild
var s = document.createElement("span");
s.appendChild(document.createTextNode("test"));
work.appendChild(s);
ready

Revisions

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