I remember having seen a new javascript compiler/ minifier on github which should even be better than google's closure compiler. Unluckily I can't remember its name and find it again. Maybe someone can help me? :)
Thanks, Corin
Minifying strips out all comments, superfluous white space and shortens variable names. It thus reduces download time for your JavaScript files as they are (usually) a lot smaller in filesize. So, yes it does improve performance. The obfuscation shouldn't adversely affect performance.
To minify JavaScript, try UglifyJS. The Closure Compiler is also very effective. You can create a build process that uses these tools to minify and rename the development files and save them to a production directory.
Google Closure Compiler As accurately as you would expect, google has a javascript minifier too. The Google Closure Compiler is with over 4500 ⭐️on github is such a great tool; it is optimized for both efficiency and speed and there is constant support around it.
See the statistics src: http://axod.blogspot.ca/2010/01/google-closure-compiler-advanced-mode.html
compare JSMin, by Douglas Crockford and Yahoo! YUI
Minifier | Bytes |% of original| gz Bytes | gz % original None | 428,264 | 100% | 91,750 | 100% JSMin | 249,372 | 58% | 57,338 | 62% YUI | 235,214 | 55% | 55,990 | 61% Closure (STANDARD) | 219,446 | 51% | 53,515 | 58% Closure (ADVANCED) | 166,774 | 39% | 47,372 | 52%
Closure takes the idea of a Javascript minifier a step further. It does this by doing real compilation to remove unused code, inlines variables and rewrites code to make it as small as possible.
Just for reference, you can access the Google Closure Compiler UI here http://closure-compiler.appspot.com/home
Possibly UglifyJS? It's the minifier that the jQuery project is currently using.
Check out these speed comparisons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With