[wp-hackers] Re: Packing JavaScript
Otto
otto at ottodestruct.com
Wed Sep 19 19:56:12 GMT 2007
On 9/19/07, Charles <lists07 at wiltgen.net> wrote:
> GZIP: 19,758 bytes
> YUI+GZIP: 10,818 bytes
> Savings of YUI+GZIP over GZIP: 45%
>
> Look, it's just the admin interface...I don't care about 9 KB if you don't.
The statistics nerd in me is forcing me to protest. :-)
-If you're saying that YUI adds 50% improvement to whatever, then
that's fine. It's pretty close to that number both ways.
-But if you're saying that it adds 50% improvement over GZIP, then
that's not fine, because it doesn't. It adds 14% improvement in the
given case, like I stated.
It's just that you're comparing the wrong things to give that
particular statistic that you're giving. YUI is not a 50% improvement
over GZIP, it's a 50% improvement over GZIP *when combined with GZIP
as well*. These are different statements.
> I just personally don't tend to pass on near-effortless ways to reduce
> bandwidth and increase real or perceived speed.
I don't consider it effortless, I consider it effort-full because of
the maintenance overhead. Yes, it's effortless to you and your site.
However maintaining the core code of a package like WordPress is not
just about you and your one site. Compressing all the JS with YUI
would involve keeping two sets of JS in the core distribution, one
compressed, one not. It would make debugging more difficult. It would
make updating the core with new versions of these libraries harder.
And it would introduce the *possibility* of incompatible compressed
code (such a thing is *always* possible, no matter what you think
about YUI... bugs can creep into any piece of code, which YUI is).
And like it has been stated, creating a plugin that would
automatically run YUI or whatever-the-heck-you-want on the JS files
would be rather trivial. Why not make such a plugin? If it proves
popular, then the core people will likely steal it for the main code.
:)
More information about the wp-hackers
mailing list