performance testing of named or anonymous functions (v30)

Revision 30 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
class Test() {
    testFunc() {
    }
}

var a = new Test();

for (var i = 0; i < 1000; ++i) {
  a.testFunc();
}
ready
function expression
function Test() {
    this.testFunc = function () {
    }
}

var a = new Test();

for (var i = 0; i < 1000; ++i) {
  a.testFunc();
}
ready
function declaration
function testFunc() {
}
function Test() {
    this.testFunc = testFunc;
}

var a = new Test();

for (var i = 0; i < 1000; ++i) {
  a.testFunc();
}
ready

Revisions

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