using innerHTML or appendChild

Benchmark created on


Description

vijay's JS perf ex

Preparation HTML

<ul></ul>

Test runner

Ready to run.

Testing in
TestOps/sec
using appendChild
window.onload = function(){
	var elm = document.createElement("li");
          elm.textContent = "i am new list";
          document.getElementsByTagName("ul")[0].appendChild(elm); 
}
ready
using innerHTML
window.onload = function(){
	document.getElementsByTagName("ul")[0].innerHTML += "<li> i am new list </li>";
};
ready

Revisions

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