Anonymous vs Named Functions

Benchmark created on


Setup

function named(x, y) {
    return x + y;
  }

Test runner

Ready to run.

Testing in
TestOps/sec
Named
for (var i = 0; i < 5; i++) {
  named(i, 20);
}
ready
Anonymous
for (var i =0; i < 5; i++) {
  (function(x, y) {
     return x + y;
  })(i, 20);
}
ready

Revisions

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