console.log performance

JavaScript performance comparison

Revision 18 of this test case created by

Preparation code

<div id="container"></div>
      
<script>
Benchmark.prototype.setup = function() {
  var container = document.getElementById("container");
  
  function doSomethingAndWriteToLog() {
    var div = document.createElement("DIV");
    var span = document.createElement("SPAN");
    div.appendChild(span);
    container.appendChild(div);
    console.log(i);
  }
  
  function justDoSomething() {
    var div = document.createElement("DIV");
    var span = document.createElement("SPAN");
    div.appendChild(span);
    container.appendChild(div);
  }

};

Benchmark.prototype.teardown = function() {
  container.innerHTML = "";

};
</script>

Preparation code output

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

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
iterations with logging
doSomethingAndWriteToLog();
pending…
iterations without logging
justDoSomething();
pending…

Compare results of other browsers

Revisions

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

0 Comments