Hacker News new | past | comments | ask | show | jobs | submit login
Some real data about JavaScript size on web pages (jgc.org)
34 points by jgrahamc on Nov 6, 2009 | hide | past | favorite | 10 comments



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]


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.


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.


Perhaps you could count how many references you see to, for example, jQuery (without worrying where it's hosted by those sites). Then assume all of those sites loaded it from Google. Then take what you know about the traffic to those sites and obtain a rough estimate of two extremes: everybody hosting locally vs. everybody hosting in a single location.

Possible?


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?


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...


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


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.


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: