6 ms·
As much as ads are annoying, this has nothing to do with the article. One man's bloat is another man's content. No need for this nag to be top comment on HN for
by thinkloop 9y ago
As much as ads are annoying, this has nothing to do with the article. One man's bloat is another man's content. No need for this nag to be top comment on HN for an article about why data isn't moving at the speed of light.
- Hoshea 9y agoHe's not making an argument for the elimination of ads, bloat comes in so many different forms. Loading entire libraries to solve trivial tasks, dragging in massive images where they don't belong, etc.
- true_religion 9y agoThey don't need to cut advertisements. Certainly, they could have as many as 10 advertisements, and only make requests to two domains---the ad network, and their own domain. Their page has a high number of requests primarily because they do not bundle their javascript, CSS, or icons. I see 95 requests that I see without adblocking, and about 20 of those requests are javascript coming out of their own WordPress instance. They're using 2 different full icon libraries and adding at least 5 more icons not contained in either.
- zeta0134 9y agoI think a large contributor to this trend is a side effect of JavaScript, which is to perform library inclusion at runtime inside the browser. Think about it. If you include a gigantic library in a compiled language, but only use 3 of its features, the rest of the library doesn't make it into your final program. Only those three features that you used do, because that's the linker's job. It takes only the features of a given library that are actually used for space efficiency reasons, and removed anything unneeded. This is possible for JavaScript, but common language usage patterns work against this goal. If you're going to use a clientside library that's fine, but you should ship only the small fraction of it that your code actually calls into, not the entire honking library, 90% of which goes untouched by the client for every user. Point here is, I agree with you, but this is a difficult problem to solve. You're asking a large number of frankly inexperienced programmers to deviate heavily from most JavaScript tutorials, and worse, most example code included in the documentation of most large frameworks.
- jdmichal 9y agoThat's standard dead code elimination, and that's only true in static linking. Dynamic linking, which is far more popular, will load the entire library into memory. And then you get interesting hybrids like Java, where libraries are dynamically linked but only the classes that are actually used are loaded. [0] The equivalent for dynamic languages is tree shaking, and is a harder or impossible problem depending on the language. When you can do something like the following in JavaScript, how do you determine what's dead or alive? var fn = document.getElementById("function").value; var input = document.getElementById("input").value; var output = functions[fn](input); document.getElementById("output").value = output; [0] EDIT: But all the method and fields within a class are loaded, regardless of whether they are used. Which is why I called it a hybrid.
- Spivak 9y agoLanguage theory question: In the case of JS is there a safe, but still useful, subset of the language where dead code elimination could be improved? Ignore if it can be detected or not, we'll pretend that the author has to certify that they followed your subset and didn't do X, Y, or Z. If they disobeyed your rules then all bets are off and the result is undefined.
- majewsky 9y agoI'm afraid it won't help much to restrict the language. For optimal dead-code elimination (aka tree shaking), you need human-level intelligence. Here's an example I posted yesterday in the thread about iOS app bloat: https://news.ycombinator.com/item?id=14618324 https://news.ycombinator.com/item?id=14618324
- 13of40 9y agoI agree - both problems can be improved independently of each other. I think "bloat" is less solvable centrally, though, and maybe just the natural consequence of making software more reusable and componentized.
- rthomas6 9y agoIt's not ads! Jquery.com, bootstrapcdn.com, cloudfare.com, cloudfront.net, google-analytics.com, fontawesome.com, Wordpress, Twitter, Facebook, Pocket, rating-widget.com, and typography.com are all used to put the content on this website, and none of them are ads.
- ouid 9y agobut this comment was
- rthomas6 9y agoBuddy I hate all that shit. I use uMatrix and block as much as I can while still seeing the real content. In fact that's how I know what the domains are.
- mhkool 9y agoI work for a company that produces a URL filter and in our experience ads and all tracking javascript is 30+% of all URLs. The code in tracking scripts varies between "short and elegant" to "massive and slow code". There is also a piece of json where the tracker thinks it is necessary to call 10 other trackers: See for example http://ib.adnxs.com/async_usersync?cbfn=AN_async_load http://ib.adnxs.com/async_usersync?cbfn=AN_async_load : AN_async_load([ {"url":"http://cm.g.doubleclick.net/pixel?google_nid=appnexus&google_cm&google_sc&uid=xxxx" http://cm.g.doubleclick.net/pixel?google_nid=appnexus&google..., "tagtype":"img"}, {"url":"https://ib.adnxs.com/getuid?https%3A%2F%2Fcm.g.doubleclick.net%2Fpixel%3Fgoogle_nid%3Dappnexus1%26google_sc%26google_hm%3D%24%7BBASE64_UID_ENC%7D%26google_cm" https://ib.adnxs.com/getuid?https%3A%2F%2Fcm.g.doubleclick.n..., "tagtype":"img"}, {"url":"http://c.bing.com/c.gif?anx_uid=xxxx&Red3=MSAN_pd" http://c.bing.com/c.gif?anx_uid=xxxx&Red3=MSAN_pd", "tagtype":"iframe"}, {"url":"http://odr.mookie1.com/t/v2/sync?tagid=V2_4265&src.visitorId=xxxx" http://odr.mookie1.com/t/v2/sync?tagid=V2_4265&src.visitorId..., "tagtype":"img"}, {"url":"http://match.adsrvr.org/track/cmf/generic?ttd_pid=appnexus&ttd_tpi=1&ttd_puid=xxxx" http://match.adsrvr.org/track/cmf/generic?ttd_pid=appnexus&t..., "tagtype":"img"}, {"url":"http://pixel.rubiconproject.com/tap.php?v=4894&nid=1986&put=xxxx" http://pixel.rubiconproject.com/tap.php?v=4894&nid=1986&put=..., "tagtype":"img"}, {"url":"http://sync.mathtag.com/sync/img?mt_exid=13&mt_exuid=xxxx&redir=http%3A%2F%2Fib.adnxs.com%2Fsetuid%3Fentity%3D8%26code%3D%5Buuid%5D" http://sync.mathtag.com/sync/img?mt_exid=13&mt_exuid=xxxx&re..., "tagtype":"img"} , {"url":"http://p.rfihub.com/cm?in=1&pub=345&userid=xxxx" http://p.rfihub.com/cm?in=1&pub=345&userid=xxxx", "tagtype":"img"}, {"url":"http://t.mookie1.com/rsp?dnv=[TIMESTAMP]&rurl=//ib.adnxs.com/mapuid?member=xxxx%26user=[xxxx]" http://t.mookie1.com/rsp?dnv=[TIMESTAMP]&rurl=//ib.adnxs.com..., "tagtype":"img"}, {"url":"http://t.wayfair.com/a/vendor_sync/user?vendor_id=1&uid=xxxx&t=1" http://t.wayfair.com/a/vendor_sync/user?vendor_id=1&uid=xxxx..., "tagtype":"img"} ]); The slowness that we experience is from delays caused by calling scripts that call scripts that call scripts, processing large pieces of javascript and network latencies. edit: and server latencies.
- bo1024 9y agoI disagree. The article claims that latency is a problem because, as a main example, users dislike slow page load times (citing Google and Bing). So it a very fair response that we can have a much bigger impact of user-perceived latency by reducing the number of requests our pages make and the size of the page.