performance testing of named or anonymous functions (v12)

Revision 12 of this benchmark created by Chandan Pasunoori on


Description

a small comparision betwean named function and function declaration

Test runner

Ready to run.

Testing in
TestOps/sec
anonymous
for (var i = 0; i < 10000; ++i) {
  var x = function() {};
}
ready
function expression
myEventHandler = function() {
  // do something
}

for (var i = 0; i < 10000; ++i) {
  var x = myEventHandler();
}
ready
function declaration
function myEventHandler2() {
  // do something
}

for (var i = 0; i < 10000; ++i) {
  var x = myEventHandler2();
}
ready

Revisions

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