Closed blickly closed 9 years ago
Your eyes deceive you! The actual output is both smaller if you're using a decent
web server. The web server should gzip the code when it sends it over the network.
Try gzipping the two code samples, and then comparing sizes.
See:
http://developer.yahoo.net/blog/archives/2007/07/high_performanc_3.html
It's hard to beat gzip. :)
Original issue reported on code.google.com by Nicholas.J.Santos
on 2010-01-04 13:44:05
But than again, not everybody has gzip enabled:
http://www.stevesouders.com/blog/2009/11/11/whos-not-getting-gzip/
Original issue reported on code.google.com by V1@3rd-Eden.com
on 2010-01-04 13:53:24
True. But if you have gzip enabled, the web server should be smart enough to serve
the uncompressed version to users that don't support it. And i'm pretty sure that in
this case, making the gzip code bigger for 85% of users is a net loss.
I've also heard web server authors say that the 15% number is an overestimate. Many
setups will actually accept gzipped code served to them, even if they say they do not.
Original issue reported on code.google.com by nicksantos@google.com
on 2010-01-04 14:11:11
I spotted an error in my expected output as there where some additional optimizes done.
(function(){var b="function",a="object"; typeof Array.prototype==a&&alert(a);typeof
Array.prototype==b&&alert(b);typeof
Object.prototype==a&&alert(a);typeof Object.prototype==b&&alert(b)})();
Should be the expected code. And it actually still compresses to a smaller piece of
code.
Sure those stats should always be taken with a grain of salt. But gzip isn't everything.
And this optimize isn't providing that
much additional gzip overhead. But it does take away allot of none gzip overhead.
Having that in mind and also the iphone cache limit. That has even be reduced to 15kb
(ungzipped size) for caching items. So
I think that this something to be considered in future version of the compiler.
Original issue reported on code.google.com by V1@3rd-Eden.com
on 2010-01-04 19:51:15
Original issue reported on code.google.com by
V1@3rd-Eden.com
on 2010-01-04 13:17:51