JavaScriptを最適化する CoffeeScriptをJavaScriptにコンパイルしたら、本番環境のサーバに配置する前に最適化を行っておくとよいでしょう。ここでいう最適化とは、空白などの不要な部分を取り除いたり、変数名を短い名前に置き換えてファイルサイズを減らす処理をいいます。最適化をすると、ソースコードの挙動を全く変えずにファイルサイズを減らすことができます。 UglifyJS(BSDライセンス)という最適化ツールは、YUI Compressor(Yahoo!が開発したJavaScript最適化ツール)やGoogle Closure Compiler(Googleが開発したJavaScript最適化ツール)などの他の最適化ツールと比べて実行速度と圧縮効率の面で非常にバランスがよく取れています。YUI Compressorと比べた場合、UglifyJSの方が圧縮効率は大幅に良く、