Noop vs function prototype

JavaScript performance comparison

Revision 9 of this test case created by Joshua Wise

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
noop literal
const NOOP_LITERAL = function () {};
NOOP_LITERAL();
NOOP_LITERAL.call(window);
NOOP_LITERAL();
pending…
noop fat literal
const NOOP_LITERAL = () => {};
NOOP_LITERAL();
NOOP_LITERAL.call(window);
NOOP_LITERAL();
pending…

Revisions

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

0 Comments