Hacker News new | ask | show | jobs
by seanwilson 3050 days ago
> Ensuring a certain level of performance is not a very easy problem to solve.

What I'm getting at is maybe AMP is Google's way to make the problem easy. Sometimes when a general problem is difficult, you're better adding restrictions to make the problem tractable.

> It's completely possible to build a slow AMP page.

Can you elaborate? How easy would it be to test AMP pages for that?

1 comments

> What I'm getting at is maybe AMP is Google's way to make the problem easy. Sometimes when a general problem is difficult, you're better adding restrictions to make the problem tractable.

It absolutely is! (Sorry if I made it sound like it wasn't). That's what the goal is of Feature Policy and other standards too: to add restrictions to make it easier to solve.

> Can you elaborate? How easy would it be to test AMP pages for that?

I keep meaning to make an example, but real work gets in the way. :)

Basic gist though is that AMP is, again, only a fuzzy approximation of good performance. You can still mess it up.

As for testing, the best thing to do is probably test from the origin server. That way you eliminate the Google cache layer and just focus on what the format itself actually accomplishes.

There was a post recently where a guy did exactly that, and the results were far from instant: https://ferdychristant.com/amp-the-missing-controversy-3b424...

The conclusion, for anyone who doesn't want to click through, is that the vast majority of the performance benefits don't come from AMP itself. They come from A) the Google cache layer and B) the fact that Google preloads the AMP page in the background before you click on it.

Interesting, thanks for the link!

Not sure I agree with this part though:

> What we know about AMP is that the technical standard in itself enforces good performance. For example, CSS is limited to 50KB and only inline, custom JS is not allowed (other than via an iframe method), and all images are guaranteed to be lazy loading. Hence, this is why AMP pages load instantly compared to a “normal” web page. It’s enforced by the standard. Right? Wrong.

If you're including several MBs of CSS and JS in a render blocking manner and even more MBs of non-lazy loading images (which really isn't unusual) you're going to have a significantly slower page. There's a lot of hate for AMP but those restrictions make a lot of sense.