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

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

Have TypeScript target CommonJS using Browserify #18

Closed DanielRosenwasser closed 8 years ago

DanielRosenwasser commented 8 years ago

The current comparisons turn out to be a little unfair because TypeScript is tested on its AMD output with Uglify. It looks like the bootstrapping and AMD prologues add quite a bit to the output.

This PR removes the AMD loader and bootstrap code, has TypeScript emit as a CommonJS dependency, and runs that through Browserify as an intermediate step.

With these changes, I get

-----------------------------------------
stat -c %s src/dist/bundle.js
14980
gzip -c src/dist/bundle.js | wc -c
3997
-----------------------------------------
samccone commented 8 years ago

just a few comments @DanielRosenwasser thanks a ton for the PR

I will land this commit along with the other ones tonight and update the graphs accordingly

samccone commented 8 years ago

Hi @DanielRosenwasser

so it seems like this example is no longer functional after this patch

screen shot 2016-02-02 at 5 59 52 pm


(you are going to want to prob want to drop the mangle commit due to my findings here https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/pull/17#issuecomment-178955003)

samccone commented 8 years ago

manually landed in https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/tree/mangle

going to ship to master with the updated assets soon

thanks again!