named or anonymous functions (v18)

Revision 18 of this benchmark created on


Setup

function sharedFunction (someParam)
    {
      'use strict';
     counter++
      return counter;
    }
    
    // counter so that all functions have side effect
    var counter = 0;

Test runner

Ready to run.

Testing in
TestOps/sec
anonymous (define and run)
var someFunction = function(someParam) {
  'use strict';

 counter++
  return counter;
};

someFunction(true);
ready
named (define and run)
function someFunction(someParam) {
  'use strict';

 counter++
  return counter;
};

someFunction(true);
ready
pre-named
sharedFunction(true);
ready
named (just define)
function someFunction(someParam) {
  'use strict';

 counter++
  return counter;
};
ready
anonymous (just define)
var someFunction = function(someParam) {
  'use strict';

 counter++
  return counter;
};
ready

Revisions

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