[jQuery] packing or mod_gzip (or both)

[jQuery] packing or mod_gzip (or both)

Hello,
as we discussed with Jörn on irc, comparing the merits of the packed vs
mod_gzip versions of jquery, here's a quick comparison:
The file size determines the time necessary to download; with mod_gzip the
time is reduced in proportion:
147460 jquery.src.js
57169 jquery.lite.js
37982 jquery.compressor.js
36062 jquery.src.js.gz
20342 jquery.pack.js
18002 jquery.lite.js.gz
11821 jquery.compressor.js.gz
10426 jquery.pack.js.gz
The 'compressor' version was obtained by running jquery.lite.js through the
javascriptcompressor.php class (plus re-adding the copyright header).
So, the compressor file itself is not very good compared to the pack.js
file. However with mod_gzip turned on, they are roughly equivalent.
Then, to further compare:
.pack
-----
CONS:
* deep code obfuscation
* uncompression done by the js engine at each page (~150ms per page, some
tests say)
PROS:
* portable (doesn't need to install mod_gzip to have the best download time)
.compressor
-----------
CONS:
* needs mod_gzip to get as small, otherwise is 70% larger (hence 70% longer
to download)
* might bork on older MSIE (which ones I don't know).
PROS:
* mild obfuscation (the debugger can work, better than with .pack)
* the code is uncompressed at the browser/OS level, once (instant)
* the uncompressed code is cached (gains 150ms at each hit)
* * *
My preference (for my own uses) is to go with jquery.compressor.js +
mod_gzip. YMMV, of course. But maybe we should provide an "official
.compressor version" for, well, people like me?
-- Fil
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/












































    • Topic Participants

    • fil