News for hackers. Stuff that matters.
Re:Node.js ES2015/ES6 support by untog on Monday April 25, 2016 @09:51AM (#11564149)
Does anyone have a decent explanation of why? I'm confused why () => {} would be slower than function(){}.bind(this).
Re:Node.js ES2015/ES6 support by tracker1 on Monday April 25, 2016 @02:47PM (#11566348)
Becaue that binding is tigher than...

    (function(){ 
      var __that = this; 
      return function(){
        /*switch __thatthat/this ref*/
      }; 
    }());
The code in question isn't just a binding, and it will have other differences... The code above is similar to what babel does iirc.

Now, that said there are other differences, such as ensuring that let variables are properly scoped and const doesn't allow reassign... that doesn't even begin with the maps and other new strong types that require additional locking and checks that will be less performant in many scenarios.

It's more about stable software with understandable, manageable code more than it is absolute, raw performance.

Re:Node.js ES2015/ES6 support by bb85 on Monday April 25, 2016 @12:38PM (#11565430)
For your specific example, probably because the implementation is different.

The most notable difference is that arrow functions do not set the "arguments" variable, but there are other subtleties.

I'm not sure how it is done in V8 and co, but if the code is highly optimized, you might have to rewrite big chunks of it, even for small differences, because your optimizations do not go along with a slightly different implementation, or to avoid painful regressions.