Hacker News new | past | comments | ask | show | jobs | submit login




Thanks for sharing the benchmarks.

I'm not sure how 6to5, or any other transpiler, could do much better. The job these tools exist to do necessarily means they can't do better than what today's browsers' JS engines will support.

Presumably in due course browsers will provide ES6 natively and so be better able to optimise code that uses tail calls in this way. Still, it's important to realise that the 6to5 implementation is much slower, and more of a forward-compatible stepping stone if you need it than something to use routinely if you like a functional programming style.


Ingvar Stepanyan, author of the original 6to5 pull request has finished submitting a series of further optimizations via https://github.com/6to5/6to5/pull/736.

I'm clocking a 110-215X performance boost: 1,255,700 - 2,384,556 ops/sec! (on Chrome and Firefox alpha builds respectively) Check out the new JSPerf: http://jsperf.com/tco/17


That's quite a speed-up, isn't it? It looks like the newly optimised version of 6to5 effectively inlines the tail call, similar to the way a real compiler would, and so avoids function call overheads altogether. Smart move. I hadn't realised the processing done by transpilers like 6to5 was so sophisticated, and I have even more respect for their developers now than I already did.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: