log-slow

Benchmark created by Olli Kankare on


Preparation HTML

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

Setup

var container = document.getElementById('container')
  while (container.firstChild) container.removeChild(container.firstChild);

Test runner

Ready to run.

Testing in
TestOps/sec
With log
var i = 0;
for (i; i < 1000; i += 1) {
    var p = document.createElement('p');
    var text = document.createTextNode('foobar ' + i);    
    p.id = i;
    p.appendChild(text);
    container.appendChild(p);
    console.log(i);
}
ready
no log
var i = 0;
for (i; i < 1000; i += 1) {
    var p = document.createElement('p');
    var text = document.createTextNode('foobar ' + i);    
    p.id = i;
    p.appendChild(text);
    container.appendChild(p);
}
ready

Revisions

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

  • Revision 1: published by Olli Kankare on