

YUICompressor rewritten from Java - Perl for 50% speed gain - Mithaldu
http://blog.booking.com/efficient-css-compression-in-perl.html

======
rossjudson
So you rewrote unoptimized Java from scratch to get a 50% speed improvement?
You probably could have gotten that by modifying a few dozen lines of the
original, which appears to be written for clarity, not speed.

~~~
Mithaldu
Note how startup time is a big factor. Also, strong claim, can you support it
and write a faster version of YUICompressor? (Also please make sure it handles
all these test cases correctly: <https://metacpan.org/source/JANUS/CSS-
Compressor-0.02/t/yui> )

~~~
RyanZAG
Any reason it can't be kept resident so you don't have to start it up all the
time? Should be a fairly simple change to add a batch mode or similar...

Alternatively, best practices appear to be to use caching of the css files:

<http://developer.yahoo.com/yui/compressor/#using>

"If you wish to minify your files on the backend (also known as on-the-fly
minification) instead of at build time, you will want to cache the minified
files in memory for optimal performance (instead of minifying the same files
over and over & minification is a time consuming process) Note that the YUI
Compressor can easily be instantiated and used from a Java-based environment
(Servlet). "

