performance testing of named or anonymous functions (v33)

Revision 33 of this benchmark created by 123123 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
var 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.