3 ms·
It's nice to see a library use Closure Compiler's advanced compilation mode.
by Yver 13y ago
It's nice to see a library use Closure Compiler's advanced compilation mode.
- tjansen 13y agoWhat's funny is that it hardly makes any difference. If you feed the source code into Closure in advanced mode, the size is 9258 bytes pre-gzip and 4109 post-gzip. In simple mode, the numbers are 9267 pre-gzip and ... also 4109 post-gzip! It was hardly worth the (relatively huge) effort to get the library working correctly in advanced mode. BTW to get down to the final size of 4089, I compress the source code with Closure Compiler in Advanced Mode, and then compress again using UglifyJS to get rid of the last 20 bytes. Closure is not perfect...
- cromwellian 13y agoThat's mostly because its a library, and so most of the optimizations you're getting are purely local in-method and no dead-code pruning. Where Closure shines is building an app whole-world, compiling both the client code, and library code together, then it can prune away all unused methods in the library.