Jun 2, 2011 at 5:10 PM
I was thinking of ripping out all the "duplicate literal combination" logic, and I was wondering if anyone had any strong opinions to the contrary.
For those who don't know, if you turn that feature on (it's off by default), the tool will find instances of literals used more than once in the code and replace them with a variable lookup, where the variable declaration is inserted into the code at
the appropriate scope and set to the value of the literal. The goal is that the minified code is smaller.
However, it doesn't help the run-time execution performance of the code -- looking up the variable name (especially if it ends up getting created in an outer scope) takes a little longer than just using the literal reference in-place. And more importantly:
using this feature in addition to server-side g-zip compression actually
increases the size of the JS download. It seems a little counter-intuitive, but it does; has to do with the entropy of the file and the way gzip identifies runs of characters to replace. So since everyone
should be using gzip on their statics [you are, right?], this feature is actually
detrimental to the performance of your webpage, both in bytes downloaded
and execution speed.
And this feature requires a lot of code in the application. A lot of complicated, hairy code, that makes the EXE and DLL larger and saps time from me that could otherwise be spent adding new features that actually help your website performance.
So I was thinking of ripping it out. What do you think?