CompressorRater 1.0.9 updates

With this release, I’ve updated the Packer compressor from 3.1 alpha 3 to 3.1 final. The Packer compressor with spidermonkey continues to be some 20x times faster than the rhino based version, making the compressorrater all that more easy to use as a your go to javascript compressor.

Holy Cow Batman, SpiderMonkey is like a bat out of hell!

Should have done this a long time ago… Instead of running the Packer compressor in the CompressorRater with Java SE 6 Scripting (aka Rhino), I’m now using SpiderMonkey… the result is a 20X speed boost for Packer! Try it yourself!

There’s a great blog post from John Resig about TraceMonkey which boosts the potential performance of JavaScript to near-native speeds in SpiderMonkey. I’m excited about the potential of JavaScript as a really high performance language!

For today’s 1.0.7 release, I also put back online the YUI (now updated to 3.0.0beta1) & ExtJS libs, and re-generated all the test results for common JS libs with Packer running native Spidermonkey.

CompressorRater 1.0.5

It’s been over a year since the last update and this update is way past due!

This is just a minor release– I’ve updated the YUI compressor to the latest version (version 2.4.2 at the time of this writing) and updated the popular library examples:

  • dojo from 1.1.0 to 1.3.2
  • jquery from 1.2.3 to 1.3.2
  • Scriptaculous from 1.8.1 to 1.8.2

and took the popular library examples offline for now:

  • YUI 2.5.1
  • ExtJS 2.0.2

I’ve got lots of great ideas for CompressorRater if I can find the time to work on it…

CompressorRater 0.9.9 Updates

I’ve finally managed to find some time to work on the CompressorRater. Updates on line today:

  • The Packer compressor is now enabled. It’s still quite slow (because the Rhino JavaScript regular expression engine is slow) but I have a plan for how to make it really fast. Hopefully that will get done soon!
  • Updated Packer to 3.1 alpha 3 version.
  • Updated YUI compressor to version 2.3.5.
  • Slightly better look and feel.

Hope you enjoy! Feedback will be welcomed and appreciated.

Compress Your JavaScript with the CompressorRater!

Ever wonder which JavaScript compressor you should use? Or which one can crunch your code down to the smallest size?

The “CompressorRater” allows you to easily play with several of the most popular freely available JavaScript Compressors on your own code, from one web interface.

You can quickly view how much compression all the tools give you both with and without gzip compression, and also view the compressed results directly.

You can also view some statistics of CompressorRater runs against the code in several popular JavaScript libraries. (Note that the compressed output of these libraries has not been tested and may not work. Before switching from a given sanctioned compressor on a given library, make sure you run through all the unit tests for that given library, using the compressed JavaScript!)

The following compression tools are rated:

  • JSMin is a conservative compressor, written several years ago by Douglas Crockford. It is considered safe (especially if you verify your code with JSLint first– an excellent thing to do anyway) because it doesn’t attempt to change any variable names.
  • Dojo shrinksafe is a very popular Java based JavaScript compressor that parses the JavaScript using the rhino library and crunches local variable names.
  • Packer by Dean Edwards, is also a very popular JavaScript compressor, that can go beyond regular compression and also add advanced on-the-fly decompression with a JavaScript runtime piece.
  • the YUI Compressor is a newer compressor written by Julien Lecomte, that aims to combine the safety of JSMin with the higher compression levels acheived by Dojo Shrinksafe. Like Dojo shrinksafe, it is written in Java and based on the rhino library.

When a given compression tool has options that you can set to tweak the compressed output, all possible combinations of options are run to show you the effects of the size differences when using those different options. Your compressed results are also viewable under all possible compressor options.

While this tool allows you to quickly test out the different Compressors, you must be sure to test your resultant compressed code diligently because JavaScript compressors aren’t perfect and can introduce subtle bugs.

Using JSLint to clean up your JavaScript code is always a great idea, and I’ve found that it can make your code work much better with any of the compressors.

I hope you find this tool useful! Check back often, because I plan to add some neat new features soon. I’m also looking forward to constructive criticism and comments on how I can improve the tool.

The CompressorRater is located at http://compressorrater.thruhere.net/

The CompressorRater

Ever since I discovered and started using JSMin a couple of years ago, I’ve wanted to see some hard numbers on how much savings can be gained by compressing JavaScript code. More recently, I’ve also started using dojo ShrinkSafe to compress some of my JavaScript code.

Lately with the introduction of a new compressor, the YUI compressor by Julien Lecomte, I’ve been inspired to write a tool to produce comprehensive compression statistics for a variety of popular compressors and also include a nice bar graph so you can easily see the compression levels visually.

I call this tool the “CompressorRater” because its primary function is to compare and rate JavaScript compressors. It can also let you view the compressed output, allowing you to use it as a general compression tool to compress your own JavaScript code.

If you’d like to take a sneak peak at the CompressorRater, it’s up here:

http://compressorrater.thruhere.net/

It currently has Packer compression disabled (unfortunately it runs too slowly for the time being– I believe it’s because regular expressions aren’t very efficient in Rhino.) I also tried running Packer right within the browser, and it’s just as slow.

I will very soon be posting the aggregated statistics and graphs for JavaScript code within various frameworks (such as YUI, Dojo, jQuery, etc.) These reports will include the Packer compression results as well!

I hope you enjoy using this tool, and I’d appreciate any feedback for improving it!