It's too bad you can't extend js in c or something. When I want a really tight loop in ruby, I'll write write the function in c and compile it into ruby. That way you can optimize the code that needs it and still have the rest of the app written at a higher level.
I'm just upgrading my ember app to ES6 but its transpiled down to ES5. Won't that kill any performance?
Also, I've never had an easy time maintaining custom functions when I control the server. I can't imagine how had it would be on someone else's browser. But, hey, who doesn't like a challenge :)
Most JS engines will already use the same "backend" for stuff like Map and Set of you ONLY stick to some of those features, so by letting the features enforce it, the transpiler can generate code that helps "hint" the VM about what you are doing so it can choose the best underlying tech and get the best performance.
On the other hand many new ES6 features are very slow right now because they are "not optimized". Scroll down to the list of unsupported syntax here to get an idea of what will cause slower JS code, then review your transpiler output every now and then to see if any of those are creeping into your code.
2
u/spinlock Jul 29 '15
It's too bad you can't extend js in c or something. When I want a really tight loop in ruby, I'll write write the function in c and compile it into ruby. That way you can optimize the code that needs it and still have the rest of the app written at a higher level.