Is there a good reason Facebook's JavaScript file for websites is 400K? Is it unoptimised? Is this just what happens in large companies? Does it do more than you'd think? I would have thought they'd have an incentive to make it fast and lean so people could comment and like faster.
You should check out Google's homepage sometime. One wouldn't expect that such a simple front would hide so many k of Javascript, but I guess it does a lot.
16% of the code on the average site belongs to Facebook
21–30 of 54 posts
Re: 16% of the code on the average site belongs to Facebook
#22Earlier quoted context omitted.
You should check out Google's homepage sometime. One wouldn't expect that such a simple front would hide so many k of Javascript, but I guess it does a lot.
Well, there is that instant search feature that starts showing results once you start typing.
Re: 16% of the code on the average site belongs to Facebook
#23Is there a good reason Facebook's JavaScript file for websites is 400K? Is it unoptimised? Is this just what happens in large companies? Does it do more than you'd think? I would have thought they'd have an incentive to make it fast and lean so people could comment and like faster.
You should check out Google's homepage sometime. One wouldn't expect that such a simple front would hide so many k of Javascript, but I guess it does a lot.
Re: 16% of the code on the average site belongs to Facebook
#24Here is a scan where the 200KB Facebook sdk.js is being transferred (62KB gzipped) just to display some like buttons. Repeat for other networks like Twitter (114KB) and Google: https://urlscan.io/result/fa422ac0-3b2c-4ba7-a182-31921cc61e.... Remember: Even if you don't mind the transfer of 200kB, that volume of JavaScript will take some time to parse, especially on mobile.
Re: 16% of the code on the average site belongs to Facebook
#25Earlier quoted context omitted.
Well, there is that instant search feature that starts showing results once you start typing.
That's gone actually, they removed it a few weeks ago IIRC. I don't use Google though, not sure if it's still enabled in some places. In fact, I'm not really sure what ktRolster is talking about; it is 150KiB, but honestly that's pretty small for a page these days, especially one with any images (today it's a google doodle, so normally it would be about 24KiB smaller).
Re: 16% of the code on the average site belongs to Facebook
#26I've built my service https://urlscan.io to some extent to be able to track the impact of certain scripts / hosts on the overall size of the website. You can find the breakdown by hostname under "Request Stats" on the right. But, for this use case, it would be perfectly sufficient to use the Chrome Devtools and filter by "facebook" for example. Here is a scan where the 200KB Facebook sdk.js is being transferred (62KB…
[1] https://developers.facebook.com/docs/plugins/like-button
Re: 16% of the code on the average site belongs to Facebook
#27Re: 16% of the code on the average site belongs to Facebook
#28Earlier quoted context omitted.
I think most people would consider HTML and CSS "code", too. Why would you not count HTML if it's in its own file, but assuming you would count it if it was JSX returned from a React component?
Probably because technically HTML isn’t so much code as it is a markup language
Re: 16% of the code on the average site belongs to Facebook
#29Earlier quoted context omitted.
Was the title changed? As it is, it clearly says '16% of the code', and to me that does imply only the javascript.
I think most people would consider HTML and CSS "code", too. Why would you not count HTML if it's in its own file, but assuming you would count it if it was JSX returned from a React component?
Re: 16% of the code on the average site belongs to Facebook
#30Earlier quoted context omitted.
You should check out Google's homepage sometime. One wouldn't expect that such a simple front would hide so many k of Javascript, but I guess it does a lot.
On my 2016 MBP Google keeps a constant 20% load on a single core. Sometimes it's even up to 60%. I really don't know what Google is doing there.