samccone / The-cost-of-transpiling-es2015-in-2016

Investigating the overhead cost of compiled es2015
1.34k stars 37 forks source link

Issue with Closure example #38

Closed concavelenz closed 8 years ago

concavelenz commented 8 years ago

Why are you using such a bad example from the Closure Compiler? You should at least specify what options you are using.

samccone commented 8 years ago

hi @concavelenz thanks for your feedback

I am using an open source es2015 implementation of todomvc, sorry that you do not like it, but it was one of the few examples of es2015 code that is fully tested and can be compiled across all of the compilers with only a few tweaks required.

Here are the options https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/blob/master/Makefile#L43

Thanks :+1:

samccone commented 8 years ago

If you feel like the language could be better in places feel free to open a PR. :sparkles:

paulirish commented 8 years ago

There's been a few comments indicating the use of closure compiler isn't good. I'm not sure I understand the sentiment here. The use of closure compiler is quite realistic use and puts the options on equal footing. The fact that closure comes out on top, even without any annotations placed is impressive already.

concavelenz commented 8 years ago

You misunderstand. It isn't the choose of code that is the issue here but that you simply say "Closure" like it wasn't a complex tool with lots of possible options. At the very least, you should be using the "--assume_function_wrapper" option (available with the head version of the compiler) to get the best out of "simple" mode (assuming you are using SIMPLE mode).

samccone commented 8 years ago

tracking here https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/issues/40

thanks for the pro tip @concavelenz

concavelenz commented 8 years ago

Could I ask for the screen shot to be updated?

samccone commented 8 years ago

I added a note last night

https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/commit/4cf85b27c2883c25f2b42cb0e06641964bc08918


Let me know if you think this could be made clearer -- the point of the screenshots was really not to drag anyone under the bus.. but rather just to show the default behavior of the compilers to illustrate the point that each compiler does something different under the hood.