Noop vs function prototype

Benchmark created by Cezary Daniel Nowak 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;};

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

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