Between Yahoo! UI Compressor, Dean Edwards Packer and jsmin, which produces better results, both in terms of resulting footprint and fewer errors when obfuscating.
A great way to compare the best compressors is The JavaScript CompressorRater by Arthur Blake.
What you're usually interested in is the size after compressing with GZIP (you should configure your web server to perform the compression).
The best results are usually from the YUI Compressor or Dojo ShrinkSafe. The differences were so small that after a while I stopped comparing and I just use the YUI Compressor.
EDIT: since the original time this question was asked, 2 new minifiers have been released. They're both usually at least as good as, if not better than, the YUI Compressor.
EDIT 2:
Better is a bit subjective here, since there are multiple factors to consider (even beyond those you list):
My recommendation is to run the code you intend to compress through several compressors (an automated comparison tool such as CompressorRater helps...), and choose based on the results - remembering to test, profile and compare the actual page load times afterward.
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