insertAdjacentHTML (v5)

Revision 5 of this benchmark created by Mayhem on


Description

node.insertAdjacentHTML performance, with two attributes.

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 class='test span' title='test'>test</span>");
ready
innerHTML
work.innerHTML += "<span class='test span' title='test'>test</span>";
ready
appendChild
var s = document.createElement("span");
s.className = "test span";
s.title = "test";
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.