JS Optimizer – Closure Compiler

The following tool helps in JS optimizing(Remove whitespace , comments, identify the unreachable code, useless code)


Add your JS script URL into the text box in the above webapp and click compile.

Original and com size will be shown. The new code is also presented as a new link.

Sample example below

  • ORIGINAL SIZE:697.74KB (160.8KB gzipped)
  • COMPILED SIZE:625.89KB (145.65KB gzipped)

More Reference URLS on the same

  1. User Documentation : https://developers.google.com/closure/
  2. Google Code Page for the Tool: http://code.google.com/p/closure-compiler/
  3. Closure compiler Java JAR Library file for download and commandline execution : http://code.google.com/p/closure-compiler/downloads/list
  4. Example Execution
    • java -jar compiler.jar –compilation_level SIMPLE_OPTIMIZATIONS –js=$tempOriginalFile  –js_output_file=$closureModifiedJsFile

Some more resources on webpage performance

  1. Performance blog http://blog.catchpoint.com/
  2. Client side web performance optimization : http://www.slideshare.net/jakob.schroeter/clientside-web-performance-optimization
  3. Articles on client side web performance : http://www.websiteoptimization.com/speed/tweak/
  4. Web Page performance thesis(2009- university of glassglow) : http://www.websiteoptimization.com/speed/tweak/web-page-performance-thesis/
    1. Thesis PDF : http://theses.gla.ac.uk/658/01/2009chiewtkphd.pdf
  5. Stoyan Stefanov Blog : http://www.phpied.com/
    1. Book of Speed : http://www.bookofspeed.com/
  6. Sultans of Speed – All great people working on webpage performance : http://www.sultansofspeed.com/

Gathering page load performance metrics using Selenium

Performance measure using selenium : http://www.slideshare.net/watsonmw/performance-monitoring-in-a-day

HAR Specification

Some resources on JS Performance

  1. JavaScript Fast Loading (Stevesouders-sfjs-2012) : http://www.slideshare.net/souders/javascript-performance-at-sfjs
  2. Steve souders (ControlJS) project : http://stevesouders.com/controljs/
  3. Fast Loading JavaScript(EU Velocity 2011) : http://www.slideshare.net/startrender/fast-loading-javascript
  4. JavaScript Optimizations(Stoyan(Y!) 2009 Presentation) : http://www.slideshare.net/stoyan/high-performance-kick-ass-web-apps-javascript-edition
  5. JavaScript debugging using firefox firebug : http://michaelsync.net/2007/09/30/firebug-tutorial-script-tab-javascript-debugging
  6. Firebug JS profiling : http://getfirebug.com/javascript
  7. JavaScript function call profiling : http://ejohn.org/blog/function-call-profiling/