I have noticed that none of the features I'd hoped would save cycles (const, generators, fat arrow functions) seem to be helping at all in the browsers of today.
I have noticed that none of the features I'd hoped would save cycles (const, generators, fat arrow functions) seem to be helping at all in the browsers of today.
Of course, it may be that some ES6 features will still be slow even after they've been optimized for, but right now, as a practical matter, I think ES6 is slow simply because the engines don't yet optimize it.
I believe ES6 fat arrow functions are slow for a similar reasons as why regular functions are slow when you use the magic arguments variable.
Arrow functions seem like they would take (marginally) longer to parse than explicit function declarations due to having a more verbose AST that does not start with unambiguous tokens. That, and you have the implicit this binding which must come with a cost. Again, in time this might be okay.
But I think that in ES6 without eval you can't refer to the current scope in a dynamic way; which means that the engine can resolve bindings at compile time without worrying about people fiddling with scopes behind the scenes, which should simplify optimisation a lot.