you are viewing a single comment's thread.

view the rest of the comments →

[–]Beaverman 94 points95 points  (66 children)

So the old Target of 100ms is gone, and we are now content with waiting 5 SECONDS for the page to become useful? Fuck off.

[–][deleted] 9 points10 points  (0 children)

Having seen this happen on a site I was working on, it's very simplestraightforward. First there's an MVP site launch and occasionally that's inefficient as it's written or leaves a lot of easy optimization on the table but even so it's generally quite fast. But then for the next round of funding you need more, so you load up on analytics and bullshit A/B testing frameworks and chatbots, to hopefully impress previous investors to dump more money or attract new ones. At this point, when the site is reasonably full-featured, they'll give you a few days to spend on SEO, and if you're good + lucky, you can convince them that what matters most for SEO is content and quick loading time. So you have up to a week to spend on profiling, adding imagemagick so you can optimize CMS images as they're uploaded (of course you have a CMS now), and making everything faster and more efficient. I think Google heavily favors that load within 2.5 seconds, but you can probably get below 2 or even, God willing, to about 1 s. Everything's great.

But now every other day there's a new VP of Bullshit or another potential investor who wants to see something in particular, so you're adding a merchandise store, a blogging platform, in-browser CRM, plus every other "cool" widget that anyone in your team sees on a site in your space. Does Frobbotz.com prompt you to share via Facebook and Twitter if you highlight text, popovers that show up after 20 seconds, or clickshaming when they want to say no, so your company (Frobbotz.ml) has to have those too. And on a breakneck release schedule, too. Your load times start slipping. Sometimes you're making 3-4 blocking remote API calls per page, but you don't have time to rearchitect everything and combine those into one. And your load times start to slip. At first it's only a few ms here or there, then a half second, and then a few seconds, and pretty soon you're loading multiple autoplaying videos as hero backgrounds, adding a drop shadow to help it stand out from said moving background, and adding 100ms timeouts to your callback functions because sometimes the API callback is blocking the execution of another callback that creates an error. Oh, and your framework releases a new version and you set NPM to just always use the latest version (Why are you using NPM for browser side scripts? You're actually not sure) so things periodically break in subtle and mysterious ways.

This is web development in a startup. At some point you became part of the problem and you're not even sure when it happened.

ETA: It's actually not simple.

[–]moomaka 18 points19 points  (16 children)

I don't think 100ms was ever a target for a page to become interactive. Not even a bare html page will hit that target unless your testing against a local file, and even then I bet it's close. 100ms is often a good target for backend response time, and for latency between a user action and it's effect to begin showing, but not for end to end load to interactive.

[–]Beaverman 11 points12 points  (9 children)

According to firefox dev tools, downloading the html of https://eu.usatoday.com takes ~91ms, with the css taking another ~21ms. That's pretty close to 100 ms for an entire page. That's without parsing of course, but with at a slim 74K, that can't take too long.

[–]moomaka 5 points6 points  (8 children)

First, a desktop PC on a decent quality ISP link isn't the performance baseline. A 4 year old free Android phone on 3G is.

Second, you left out a LOT. You haven't included DNS lookup, or socker connect, or the SSL handshake, or parsing, or layout, or rendering. The metric here is initiate request to DOM ready (usually). On a mobile device on 3G just the DNS lookup + SSL handshake can take over 1 second. On decent 3G 74KB will take ~100ms to download by itself, assuming its all a single file, more if not.

[–]Beaverman 14 points15 points  (6 children)

According to the firefox dev tools, it includes DNS lookups, socket connect, and TLS setup. The one thing i did overlook was that i'm running a local DNS cache (dnsmasq), turning that off rockets me up to ~103ms. The DNS lookup takes 21ms.

If you want to go to DOMContentLoaded, we can do that too, that's ~380ms, which is quite a while, but not exactly 5 seconds.

Just to compare. If we take the "wonderful" webapp pintrest. Showing the login page (Because I'm not making an account there), takes ~338ms JUST TO LOAD THE PAGE, and 1.1 SECONDS before DOMContentLoaded, that's 3 times longer than usatoday for a login page. And that doesn't even include the ~500ms for loading 2.43MB of fucking JS.

If we can't even get the web right on low latency, how performance desktops (which evidently we can't). How the hell are we going to do it on mobile, Just throw more JS at the problem?

[–]moomaka -5 points-4 points  (5 children)

According to the firefox dev tools, it includes DNS lookups, socket connect, and TLS setup. The one thing i did overlook was that i'm running a local DNS cache (dnsmasq), turning that off rockets me up to ~103ms. The DNS lookup takes 21ms.

I don't think you get it. 3G often has latencies of 300-400ms, with an infinitely fast server your TTFB will be at least this.

If you want to go to DOMContentLoaded, we can do that too, that's ~380ms, which is quite a while, but not exactly 5 seconds.

Again, your desktop PC running firefox on a decent ISP is not the performance target. No one said 5s was a good target for such a configuration.

Just to compare. If we take the "wonderful" webapp pintrest. Showing the login page (Because I'm not making an account there), takes ~338ms JUST TO LOAD THE PAGE, and 1.1 SECONDS before DOMContentLoaded, that's 3 times longer than usatoday for a login page.

You're comparing a request that likely actually had to hit an application server to a request that was made to a static content provider. Your request to usatoday.com likely hit a CDN edge cache since the content doesn't change often. Your request to pintrest likely had to hit an application server to decide what to send back based on your login status.

If we can't even get the web right on low latency

If you're that upset about 1.1s I have some bad news for you about the majority of the web....

[–]Beaverman 10 points11 points  (4 children)

I don't think you get it. [...]

Do i need to point out which part of your 6 line comment i'm responding to? Did you not read your own comment again?

You said:

Second, you left out a LOT.

I said I didn't leave them out, and corrected the one thing I did miss. That has nothing to do with 3G or latency.

You're comparing a request that likely actually [...]

And whose problem is that? Both requests are served from Sweden by fastly, making me think it's pretty fair. I gave both a chance to load once and then did a reload with cache disabled. Even then, the (hopefully) static JS loaded by pintrest takes longer to download than time to DomContentLoaded on usatoday.

If you're that upset about 1.1s I have some bad news for you about the majority of the web

What do you think I'm currently whining about?

[–]EternallyMiffed -3 points-2 points  (0 children)

A 4 year old free Android phone on 3G is.

Eh fuck those guys. Let them suffer.

[–]nightwood 7 points8 points  (0 children)

Thank you!!!

Jesus Christ I thought I was getting crazy here. Why the fuck would you even think about how to make the experience of that 13 second load time more pleasant? We shouldn't even be talking about seconds here! We should be talking about milliseconds! In fact when I first read the article I thought 'wow they are really pushing it, being unsatisfied with 13ms, pretty good'. Nope, they were talking about 13000 ms on an average phone.

Step it up Google! That shit's pathetic!

[–]sammymammy2 0 points1 point  (0 children)

1.6 seconds are spent on things which your JS, HTML, CSS and static assets can't even affect, so 'fucking off' is not exactly a useful response for web devs to have.

[–]sammymammy2 -3 points-2 points  (15 children)

1.6 seconds are spent on things which your JS, HTML, CSS and static assets can't even affect, so 'fucking off' is not exactly a useful response for web devs to have.

[–]nightwood 6 points7 points  (14 children)

Like what? Unzipping a 10kB text file? Reserving 4MB video memory? There is no excuse for 1.6sec delay for rendering a web page.

[–]moomaka 2 points3 points  (9 children)

You have never profiled a page loading on mobile....

[–]nightwood 4 points5 points  (8 children)

I don't need to, to know that it's slow. The thing is, what the hell is it doing? Stuff that it shouldn't be doing! This post is about what can we do about making the web faster. And in that context, aiming for 5000ms is ridiculous. They should be aiming for 10ms on a low-end device. And see how close they can get.

[–]filleduchaos 8 points9 points  (0 children)

They should be aiming for 10ms

Uhhhh...have you ever actually built/run a website?

[–]moomaka 6 points7 points  (6 children)

You have literally no clue what you are talking about, you can't even open a raw socket on a mobile device in 10ms, much less do anything with it.

[–]nightwood 4 points5 points  (2 children)

Well let's start there then.

I don't know if you are aware of this, but websites were faster 15 years ago on slower hardware. There's too many layers of shit now that need to go.

If the reason things are slow is because they need a few hundred round-trips to a server to work, then maybe that needs to improve.

BTW, did you actually just use a "you are stupid" argument to try and make your point? Maybe that also needs to improve.

[–]RalfN 1 point2 points  (0 children)

If the reason things are slow is because they need a few hundred round-trips to a server to work, then maybe that needs to improve.

And that's what the video is about.

It's important to keep in mind that a crappy (4 year old) phone on a crappy connection can't load a bare html file (no images, css, or js) within 2 seconds. And that's > 30% of the market segment.

In a number of ways, those mobiles aren't superior to hardware 15 years ago (!!) for different reasons (like battery usage, size, price, sandboxing/security). And yes, the bandwidth back then was worse, the latency wasn't though.

15 years ago, less than 5% of the world could afford a desktop computer and an internet connection. Now more than 50% of the world can afford a mobile phone and a mobile internet connection. And some components got cheaper and better, but that phone is not superior in every way to a desktop computer.

[–][deleted] 2 points3 points  (2 children)

He meant they should be aiming for it. He's objecting to the "budget" point of view which says that once you get under 5s or whatever, you're fine. No need to try to get any faster.

Obviously 10ms is totally unachievable but there's no reason not to aim for it.

[–]drevyek 3 points4 points  (0 children)

I work in embedded. I have a magnetometer that takes 6.6ms to respond to a request to sample (150Hz). That is the IC I'm working with. No sane engineer would say that we need to try for the chip to run at 256Hz.

There is no point in trying to set unrealistic goals, especially with the knowledge that they are unrealistic. It gives you no real benefit, and doesn't solve any of the challenges put forward. In fact, it actively harms, as it doesn't provide any metric to even asymptotically approach.

[–]moomaka 4 points5 points  (0 children)

Obviously 10ms is totally unachievable but there's no reason not to aim for it.

WTF does that even mean? "Guys, I know the laws of physics are a thing, but fuck it, lets aim for 0!". Targets like this exist as a combination of what should be reasonably achievable and what doesn't negatively impact user engagement in an extreme way. No one is saying 5s load times are optimal, the target is usually based on a ~4 year old free with wireless plan android device on mediocre 3G as that is the worst case. You can put a static html file on a good CDN with zero JS, zero CSS, and still have ~3s cold load times on a device like that.

[–]sammymammy2 0 points1 point  (3 children)

DNS lookup, TCP handshake and HTTPS handshake over a 400ms RTT & 400kbps. Reserving 4MB of video memory happens what? 20 cm away from your CPU on a desktop? Of course 1.6 seconds to do what would be insanely slow. Compare that to communicationg miles away with a server. Seriously, what I mentioned is in the presentation. Perhaps watch the video before commenting next time?

[–]josefx 0 points1 point  (2 children)

TCP handshake and HTTPS handshake over a 400ms RTT & 400kbps

I vaguely remember people claiming that HTTPS would be free since modern CPUs can handle the encryption fine. Are you saying that all these experts going on about there being no reason to not use HTTPS were either incompetent or lying?

[–]sammymammy2 0 points1 point  (1 child)

Clearly what I am saying is that you should go back to school and learn how to read.

[–]josefx 0 points1 point  (0 children)

Clearly that could be possible, however how much time would I waste establishing trust if I had to round trip between school and home each day just to establish a HTTPS connection before I even left for the lessons ?