function expression or declaration (v9)

Revision 9 of this benchmark created on


Description

Testing if function expressions produce more garbage.

Test runner

Ready to run.

Testing in
TestOps/sec
function expression w/o closure
var test = function() {
    var a = function() {
          return "do something";
        };
    return a
};

test();
ready
function declaration w/o closure
var test = function() {
    function a() {
      return "do something";
    };
    return a
};

test();
ready
function expression w/ closure
var a = function() {
    return "do something";
};
var test = function() {
    return a
};

test();
ready
function declaration w/ closure
function a() {
  return "do something";
};
var test = function() {
    return a
};

test();
ready
named function declaration w/o closure
var test = function() {
    var a = function a() {
        return "do something";
    };
    return a
};

test();
ready
named function declaration w/ closure
var a = function a() {
    return "do something";
};
var test = function() {
    return a
};

test();
ready
named function declarations
function a() {
    return "do something";
};
function test() {
    return a
};

test();
ready

Revisions

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