Performance Named function vs Lambda

JavaScript performance comparison

Test case created by totszwai

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  this.allyourbases = "all your bases";
  var that = this;
  function named() {
    let blah = "hello world";
    let blah2 = [];
    for (let i = 0; i < 10; i++) {
      blah2.push(i);
    }
    blah2.push(blah);
    blah2.push(that.allyourbases);
  }
  

};
</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
named function
named();
pending…
"lambda" for IE11
(function() {
    let blah = "hello world";
    let blah2 = [];
    for (let i = 0; i < 10; i++) {
      blah2.push(i);
    }
    blah2.push(blah);
    blah2.push(that.allyourbases);
})();
pending…
lambda
(() => {
    let blah = "hello world";
    let blah2 = [];
    for (let i = 0; i < 10; i++) {
      blah2.push(i);
    }
    blah2.push(blah);
    blah2.push(this.allyourbases);
})();
pending…

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

Compare results of other browsers

0 Comments