normal function vs anonymous

Benchmark created by yao on


Setup

function run1(i) {
      return i;
    }
    
    var run2 = function(i) {
      return i;
    };

Test runner

Ready to run.

Testing in
TestOps/sec
normal function
for (var i = 0; i < 10000; i++) {
  run1();
}

 
ready
anonymous function
for (var i = 0; i < 10000; i++) {
  run2();
}
ready

Revisions

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