
Why is the web so slow? - ssttoo
http://calendar.perfplanet.com/2013/why-is-the-web-so-slow/
======
rdtsc
Latency is funny, it is so because:

* It is additive. It is necessary for just one component in the chain to add latency (monitor refresh, uncompressing, a bad cable modem, a bad router in the path, overloaded server, bloated JS code in the page). It is very hard to remove (one can argue impossible, but I am thinking of a multi-path set up with redundant hardware or network connections)

* Even though we can process teraflops per second on home GPU cards, our websites load about as a fast as they did 10 years ago.

* Border-line imperceptible UI or audio latencies still lead to bad user experience. They might not even know why they don't like it but in an A/B test they would pick the faster more response one. This was the case with Android vs Apple up until not too long ago. Even tiny UI jerkiness is enough to annoy a large number of users.

* OS and whole software stacks are usually designed for improved throughput not low latency processing. It takes tuning (proc and sys params) or even installing a special kernel to get better latency support for low level code.

* More benchmarks also measure throughput more than latency. Software is often picked and compared based on throughput, latency is second citizen most often. In a sequential setup for example, the two are compliments of each other, the more requests per second, the lower the latency of each request. It is only in concurrent and parallel contexts when latency starts to behave widely different. Send 100 requests at the same time towards the server? What happens? Do 50 get processed in 1ms but the rest block for 25ms?

* Low latency and liveliness has to be baked into the innards of the system/VM/framework. Depending on what is picked (and it often is picked based on throughput) a lot of time might end up being wasted fighting latency in a highly concurrent situation.

~~~
pointernil
Very insightful.

"More benchmarks also measure throughput more than latency.": Yup, latency
benchmarks are really very hard, especially when humans are involved (UI/UX),
due to biases and the way perception and cognition quite often try to adapt
sparing us "the worst of latency" but at the same time leave us with a gut
feeling of "lag". The journey J. Carmack undertook to find and work around
latencies for the Oculus Rift is good example for all this, i think. You can't
do this for each and every app to give all users this "snappy" feeling...
especially when a huge system like "the internet" is involved.

I believe there is also "latency creep": even if "a system" has low latency at
the beginning, operating it, maintaining it and especially scaling it will
more easily accept increased latency than lower throughput... up to an
threshold of course when the system becomes "apparently and _unbearably_ slow"
(still not the case for google, facebook etc. i guess)

Add servers to a farm because the median req. latency increased by 30%? Hmm...

Add servers to a farm because the number of users increased by 30%? Sure! ;)

So most probably facebook, yahoo etc. are missing serious absolute latency
SLAs [1] and those huge organizations as a whole tend to neglect them until
things break... they don't care about "slow(ish)".

[1] [http://en.wikipedia.org/wiki/Service-
level_agreement](http://en.wikipedia.org/wiki/Service-level_agreement)

ps: it's "funny" to see the gaming big-biz industry fighting this: they are
huge organizations willing to accept "slow" if the money comes in right, at
the same time some of them are in a market where the customers are much more
sensible to this issues than the typical facebook is slow poster.

~~~
rdtsc
> I believe there is also "latency creep":

Very good point. I'll have to steal that phrase. Latency is additive in the
system but also over time usually. Prototypes look good from then on it is
usually just API layers, paths and more code on top. Those usually add latency
to the stack.

~~~
pointernil
... and I will have to steal your additional and concise points from the
software _development_ perspective ;)

Thinking about it, maybe to ensure some latency awareness we should adapt the
"timeout-exception" concept in areas it is not used today. Given some runtime-
lib support call sites in a project could be given a timing threshold to
complete their work... if the threshold is exceeded an exception could break
the code-flow in a specially prepared build of the project. In very modern
dynamic environments ;) such thing could be implemented by transparently
wrapping the call sites (via attributes, annotations, monads etc), in more
traditional env. the compiler could generate specially adapted code measuring
the latency using the high precision timers most CPUs provide...

------
brownbat
Designers aren't the only ones with work to do.

CDNs appear to be messing with performance in ways that aren't really
transparent to users or content providers.[1]

We need better tools than speedtest sites. We need a way to see an ISP's
provision of popular sites over time.[2]

Or just encrypt everything and bounce it through proxies or route anonymizers,
make that standard. Either way.

[1] [http://mitchribar.com/2013/02/how-to-stop-youtube-sucking-
wi...](http://mitchribar.com/2013/02/how-to-stop-youtube-sucking-windows-
guide/) ;
[http://www.reddit.com/r/technology/comments/13kmvd/have_time...](http://www.reddit.com/r/technology/comments/13kmvd/have_time_warner_internet_but_can_barely_stream/)

[2] [http://www.youtube.com/my_speed](http://www.youtube.com/my_speed) may be
an example worth following for Netflix, Vimeo.

~~~
mikkelewis
Regarding [2]...

[https://www.evernote.com/shard/s74/sh/f033a734-455b-427a-90a...](https://www.evernote.com/shard/s74/sh/f033a734-455b-427a-90a2-1be92ac5c5b4/fbb4a3d57bc0b9d62a1b5dc184b4f4be)

SF: Is there something that I'm missing that isn't shitty comcast? (And I'm
not eligible for Webpass, though I can dream)

~~~
wooster
Comcast Business Class is pretty solid in SF (as opposed to their normal
service, which I've also had and is terrible).

------
ojbyrne
As a Canadian I notice as 2 consecutively ranked queries:

"Why are Canadians so rude"

"Why are Canadians so friendly"

And I'm suddenly reminded of Jay Leno's "Jaywalking" segments. And my guess is
that for the majority of these queries, it's because the person has 7
different toolbars loaded into IE. IE8 if we're lucky, but probably IE7. Maybe
IE6. Plus they probably have a ton of autostart crap on their computer and
don't know how to differentiate between "my computer is slow" and "the web is
slow."

~~~
vxxzy
I wholeheartedly agree! After spending half my career cleaning up malware,
this seems to be the #1 reason for performance complaints.... That, and the
fact many vendors pre-load crappy software to subsidise the cost of the PC...
It is hell for the average everyday user. We here know better than to click on
the numerous green ad 'Download Now' buttons that litter a single page.

------
bowlofpetunias
Block all advertising, tracking an analytics, and a considerable part of the
web becomes much faster.

The amount of worthless crap that comes with a simple web page where only a
bit of text is relevant is staggering.

------
chavesn
I believe this is one of the most, if not _the_ most, under-appreciated
"features" of websites and software (all types, including games).

It _directly_ affects usability and therefore user engagement. And that means
it directly affects the bottom line for most companies.

But most companies fail to see or ever really do anything about it.

------
pubby
I have a feeling that most of those searches could be answered by, "It's
because you're on an unreliable internet connection".

~~~
Joeri
Shouldn't we then build sites with that assumption in mind?

For example, why is It that almost no site uses appcache, when it is a way of
ensuring that resources are already local and the only network traffic is the
truly essential part? Why do we care about retina imagery, when it is obvious
that the majority of users get a worse experience as a consequence? Why have
sites doubled in size in two years time without adding a meaningful percentage
in content?

These all point to an industry that lacks perspective on their user's actual
user experience because they are sitting on a nice fiber line two hops from
the server.

~~~
derefr
I believe the canonical answer to that is that even Google Search, the page
you'd expect to be the most cacheable bundle of HTML/JS/CSS on the Internet,
has to deliver its pages from a "cold-start" more than 60% of the time. Making
sure visits 2..N work smoothly won't improve the average user's experience
when most of them are on visit 1.

------
WD-42
I'm pretty sure 95% of those searches are people googling "why is X so slow"
when they are having connection issues, as opposed to wondering why in general
a service is always so slow.

~~~
croisillon
And those people never come back asking google "why is facebook so fast" or at
least "back to normal". Obviously a search engine reflects more problems than
good things.

------
alan_cx
How many people are going to google: "why is facebook so fast" ?

------
fanssex
tried "Why is my computer " or "Why is my car"? It's just some pattern picked
up by the search engine. no thing is fast enough.

~~~
phaer
Yes, it works even with "Why is my brain..."

And maybe some things are fast enough, but nobody searches for "why is my
computer fast enough" or "why is my brain too fast"

------
cclogg
This should apply to games too lol. I hope one day we can rid the world of the
'load screen'! Perhaps with more SSDs and developers putting effort into
streaming (both from net and hard-drive), it'll be possible ;)

~~~
spoiler
I'm hardly an expert on games, but I think I hardly think streaming from the
hard drive would a big improvement. You would (at best) see stuff partially
loaded, or there would have to be some generic replacement (assuming it's a 3D
game) for textures, meshes and what not. This would prove to be just as
annoying, if not more so.

~~~
babebridou
The key is the pacing of the asset streaming relative to the rate of
environmental change the player is creating on the screen.

Streaming essentially disables fast travelling and teleporting to some extent,
but makes slow travelling seamless and much, much more enjoyable. World of
Warcraft was among the first online games to get it about right at launch, and
I'm pretty sure the absence of loading screens was a huge factor in its
universal acclaim.

~~~
alsocasey
A more recent example would be Diablo 3. There the absence of load screens and
on-demand asset loading resulted in performance problems which persist to this
day. I believe they're even considering re-introducing loading screens in the
expansion.

------
lazyjones
Because some people use 1MB+ .png images to measure latency of involuntary
testers (visitors)?

(the OP contains:
[http://lognormal.net/boomerang/config.js](http://lognormal.net/boomerang/config.js))

------
jawr
Because: [http://www.renesys.com/2013/11/mitm-internet-
hijacking/](http://www.renesys.com/2013/11/mitm-internet-hijacking/)

------
tagawa
Because of incessant cryptocurrency price checking?

------
jokoon
It's slow because it's text based. I think there could be advantages to
switching to compiled html or any other open binary page format. It would be
less flexible, but at least it would be less abused: no more pages and pages
of CSS, weird js widgets, blurbs of html. Compressing html with gzip is not
that much efficient either.

I don't think it's a great idea, but in some case it would sort of force
everyone to make content that is just lighter.

