Noop vs function prototype

JavaScript performance comparison

Revision 8 of this test case created by Tobias Lundin

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;};
  var NOOP7 = () => {};
  var NOOP8 = () => ();
  var NOOP9 = () => 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 with => {}
NOOP7();
NOOP7.call(window);
NOOP7();
pending…
noop with => ()
NOOP8();
NOOP8.call(window);
NOOP8();
pending…
noop with () => null
NOOP9();
NOOP9.call(window);
NOOP9();
pending…

Revisions

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

0 Comments