Noop vs function prototype (v2)

Revision 2 of this benchmark created on


Setup

var NOOP1 = Function;
    var NOOP2 = function() {};
    var NOOP3 = new Function;
    var NOOP4 = Function.prototype;
    var NOOP5 = function() {return;};
    var NOOP6 = function() {return null;};
    var NOOP7 = function() { return undefined; }
    var NOOP8 = function() { return false; }

Test runner

Ready to run.

Testing in
TestOps/sec
Function constructor
NOOP1();
NOOP1.call(window);
NOOP1();
ready
Noop
NOOP2();
NOOP2.call(window);
NOOP2();
ready
Noop from Function constructor
NOOP3();
NOOP3.call(window);
NOOP3();
ready
Function prototype
NOOP4();
NOOP4.call(window);
NOOP4();
ready
noop with return
NOOP5();
NOOP5.call(window);
NOOP5();
ready
noop with return null
NOOP6();
NOOP6.call(window);
NOOP6();
ready
noop with return undefined
NOOP7();
NOOP7.call(window);
NOOP7();
ready
noop with return false
NOOP8();
NOOP8.call(window);
NOOP8();
ready

Revisions

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

  • Revision 1: published by Cezary Daniel Nowak on
  • Revision 2: published on