performance testing of named or anonymous functions (v29)

Revision 29 of this benchmark created 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() {};
  x();
}
ready
function expression
myEventHandler = function() {
  // do something
}

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

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

Revisions

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