

Some real data about JavaScript size on web pages - jgrahamc
http://www.jgc.org/blog/2009/10/some-real-data-about-javascript-tagging.html

======
Maciek416
Hi,

This is awesome and thanks for posting it.

Question: Towards the end of your post you mention your amazement regarding
how much of non-image content is accounted for by JavaScript code, citing 200K
Facebook libraries and such. Could you comment a little bit about the mix
between CDN-hosted JS and locally-hosted JS?

From your data, would you be able to speculate on the amount of efficiency
gain (in bytes transfered and average latency across the visitors to the top
1000) that could be had if we aggressively re-configured this entire mass of
sites to use jQuery/Prototype/etc from a single location rather than on their
own sites?

Thanks

[edit: formatting]

~~~
jgrahamc
I don't have a dead easy way to extract that information in general,
unfortunately. It's something that I do look at the jQuery and YUI (to see
whether they are taking the hosted or self-hosted versions), but for generic
JavaScript I don't have CDN information.

~~~
Maciek416
Addendum: Another interesting thing would be to load every single piece of js
from all of these sites and compare it against a minified version of itself.

------
pierrefar
Interesting upward kink starting in August/September in the average number of
JS tags on a page. Any idea why? Any particular tag in the data showing a
similar trend?

~~~
jgrahamc
I'm pretty sure that the answer to that is the comScore Beacon used by the
comScore 360 product.

[http://www.comscore.com/Press_Events/Press_Releases/2009/5/c...](http://www.comscore.com/Press_Events/Press_Releases/2009/5/comScore_Announced_Media_Metrix_360)

------
aristus
What script did you use to generate this data? webkit2png?

~~~
jgrahamc
I wrote my own spider in RoR (to manage a database of historical information
since I run it weekly). The spidering is done by controlling Firefox using
Selenium from the RoR application.

~~~
strick
I'd love to have a copy of this spider if you ever decide to open source it.
I've built WATIR-based robots to drive a browser to do useful stuff before,
but have not yet tinkered with Selenium.

~~~
aristus
I'm working on a "headless safari" script for performance testing. It's based
on Paul Hammond's webkit2png. There's also Perl's WWW-Mechanize.

It seems kind of odd that these kinds of programs tend to be either one-trick
hacks, or hugely complex "suites" like Selenium.

