console.log performance (v5)

Revision 5 of this benchmark created on


Preparation HTML

<div id="container"></div>

Setup

var container = document.getElementById("container");
  
  function doSomethingAndWriteToLog() {
    for(var i = 0 ; i < 1000 ; i++) {
      var div = document.createElement("DIV");
      var span = document.createElement("SPAN");
      div.appendChild(span);
      container.appendChild(div);
      console.log(i);
    }
  }
  
  function justDoSomething() {
    for(var i = 0 ; i < 1000 ; i++) {
      var div = document.createElement("DIV");
      var span = document.createElement("SPAN");
      div.appendChild(span);
      container.appendChild(div);
    }
  }

Teardown



            container.innerHTML = "";
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
iterations with logging
doSomethingAndWriteToLog();
ready
iterations without logging
justDoSomething();
ready

Revisions

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