Noop vs function prototype

JavaScript performance comparison

Test case created by Cezary Daniel Nowak

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var NOOP1 = Function;
  var NOOP2 = function() {};
  var NOOP3 = new Function;
  var NOOP4 = Function.prototype;
  var NOOP5 = function() {return;};
  var NOOP6 = function() {return null;};

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Function constructor
NOOP1();
NOOP1.call(window);
NOOP1();
pending…
Noop
NOOP2();
NOOP2.call(window);
NOOP2();
pending…
Noop from Function constructor
NOOP3();
NOOP3.call(window);
NOOP3();
pending…
Function prototype
NOOP4();
NOOP4.call(window);
NOOP4();
pending…
noop with return
NOOP5();
NOOP5.call(window);
NOOP5();
pending…
noop with return null
NOOP6();
NOOP6.call(window);
NOOP6();
pending…

Compare results of other browsers

Revisions

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

0 Comments