noop vs if flag vs log

Benchmark created by michele on


Setup

log = function() {};
    log_enabled = false;

Test runner

Ready to run.

Testing in
TestOps/sec
noop
log('test');
ready
flag
if (log_enabled) {
   document.write("test");
}
ready
log
console.log('test');
ready

Revisions

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

  • Revision 1: published by michele on