News for hackers. Stuff that matters.
Re:The Story of Google's Closure: Advanced JavaScript Tools by andrewljohnson on Monday November 09, 2009 @12:29AM (#930456)
What he doesn't tell you is how much the Reader code would be if it was just gzipped. That's the real comparison to make.

If gzipping alone would get the code down to 800kb or something, then the improvement made by closure doesn't seem so awesome.

Nonetheless, it's obviously good to get the file size down to the absolute minimum when you are going to serve millions or billions of copies.

Re:The Story of Google's Closure: Advanced JavaScript Tools by nostrademons on Monday November 09, 2009 @12:49AM (#930479)
I've seen (and used) benchmarks with compressors other than Closure. The compiled + GZipped size is usually about half the size of the just GZipped file. Closure may do a bit better because it performs pretty aggressive dead-code elimination. 800K-1MB sounds pretty reasonable as a rough estimate.

I'd disagree on this not being awesome, though. 800K -> 143K is huge. You're talking about shaving several seconds off your user-visible load times. You get less cache thrash through having smaller pages. And at Google scale, this could be exabytes worth of bandwidth per month.

I've had code reviews held up while I shaved 3 bytes off the compiled GZipped size, and proposed changes vetoed because they'd add 19K to the GZipped JS size. The entire JS for websearch is something like 13K. Saving 600K+ is absolutely enormous.

Re:The Story of Google's Closure: Advanced JavaScript Tools by patio11 on Monday November 09, 2009 @01:55AM (#930533)
You're talking about shaving several seconds off your user-visible load times.

This is the sort of statement that SHOULD set off a veritable explosion in your head of "If what he is saying is true, that is awesome. Seventeen exclamation points elided here!", because shaving seconds off user-perceptible load times results in huge, automatic, reproducible impacts to the bottom line, across a wide range of different web sites. You can reproduce it for yourself by A/B testing adding unnecessary delay into your pages versus not adding unnecessary delay, and watching what it does to conversions. Google has done this: they've found that less load time means more searches, which means more money. Amazon has done this: they found that 1 second more means 1% less -- revenue, that is.

Although I don't routinely A/B test bad practices against the default to make a point, I did get a handful of percentage points worth of free conversion back when I first saw one of the YSlow presentations and got religion on this. Seriously -- if you don't already pay attention to page load speed, you have a money tree in your back yard. Go put a basket under it and shake a bit.

Re:The Story of Google's Closure: Advanced JavaScript Tools by JeffJenkins on Monday November 09, 2009 @08:02AM (#930803)
Did Amazon (or Google) publish this result?
Re:The Story of Google's Closure: Advanced JavaScript Tools by patio11 on Monday November 09, 2009 @08:27AM (#930838)
Re:The Story of Google's Closure: Advanced JavaScript Tools by louismg on Monday November 09, 2009 @01:44AM (#930527)
At Google scale is a major point. Exabytes of bandwidth. Amazing to think about.
Re:The Story of Google's Closure: Advanced JavaScript Tools by wayne on Monday November 09, 2009 @01:04AM (#930495)
Also, in terms of running speed, Closure is a better form of compression than gzip since the JS engine still has to parse all that ungzip'd JS.