
How fast is AMP really? - niutech
https://timkadlec.com/remembers/2018-03-19-how-fast-is-amp-really/
======
niutech
If you want to test how fast are AMP pages compared to full pages, check out
the AMP Browser Extension: [https://chrome.google.com/webstore/detail/amp-
browser-extens...](https://chrome.google.com/webstore/detail/amp-browser-
extension/mccnchmofleakpdohkmljohfckgpdehb)

------
buro9
You might not realise how much AMP you come across every day.

Your web browsing isn't it at all.

If you are on an Android phone go install NetGuard and take a look at the
logs.

There are a few domains that come up for almost every app:

1\. graph.facebook.com

2\. graph.accountkit.com

3\. .crashlytics.com

4\. .ampproject.net

5\. .segment.io

AMP Project is up there. The majority of the apps on my phone now do their
content via WebView + AMP.

In this AMP have found their niche.

------
kmfrk
The most infuriating part of AMP for me is that I can't count the number of
times I'd read an AMP version of an article, and graphics in it were just
plain _missing_ without any heads up. Why newspapers and the like would gimp
their own work like that is beyond me.

------
Too
So nowadays 61 requests per page load is considered an _" accelerated"_ page?
Might not be so bad with http2 but still wow. Maybe publishers should start
working on that number if they want actually faster web pages.

~~~
emilfihlman
It depends on if you pack your data or not, really

With simple development on a moderate website you might have a couple of html
resources, a few css files and some js files to fetch, not to mention all the
media (images, videos and audio).

It's easily half that just by doing sane development where you split
functionality into files and if your site is media rich it's not surprising at
all.

------
gregoryjenny100
Do you want to hack into your spouse's phone remotely without touching his or
her phone You can hack into any devices to access facebook , whastapp , text
mssg , call logs etc to know who they have been talking to and if they're
cheating on you remotecyberhacker@ gmail com he's the fastest,reliable and
cost-effective you can ever come across cos his name has never been SOILED ,
in shrot....he's the best working for me . text/call ; + 1 3 4 7 89 93 01 7
whatsapp ; +1 267 52 6 53 4 6

------
notatoad
i tried to turn these tables into graphs because charts of numbers weren't
doing much for me. but i suck at spreadsheets, so i don't know how to label
these:
[https://docs.google.com/spreadsheets/d/1ZFWiqXesq8SlOZ3uW9Om...](https://docs.google.com/spreadsheets/d/1ZFWiqXesq8SlOZ3uW9OmRdEtPl1k4VG8dHoS47i3tQI/edit?usp=sharing)

(the bars are raw/cached/canonical, and the groups on the X axis are
min/max/median/90th)

------
waytogo
Stopped using AMP.

Created a site in pure AMP. All competitors didn't use AMP then (1 yr ago). My
site was the fastest, didn't have any ads, was the lightest, the most
beautiful, had the best UX flow.

SEO-wise my site still doesn't list on the keywords which are in H1 and the
page title but all the crappy, non-AMP, megabytes big slow-loading, ads-heavy
competitor sites are still in the top ten SERP.

Guess that even Google stopped giving AMP sites any special rank power except
they are news sites (then you will see them probably in the carousel but only
if they are accepted with Google News).

~~~
Guest9812398
Isn't it in Google's best interest to list the ad heavy sites first? They
don't receive any commission sending users to your ad free site, but they'll
earn 32% of AdSense profits from your competitors.

Now, I don't believe that is actually occurring, but it's one of the many ways
that our interests and Google's interests do not align.

------
thrownaway954
it's funny how so many people use to ridiculed ColdFusion and Asp.Net WebForms
for "re-inventing" and "polluting" HTML with their custom tags and server
components respectively. This is exactly what AMP is.

------
tscs37
The first point in the article is the dead killer of AMP for me. My mobile
provider gives me very little monthly data, I've stopped using AMP because
preloading the AMP results is eating through my cap, with images disabled.

Without preloading, AMP is slower than the non-AMP version of the same webpage
with a simple script blocker. And usually causing more traffic too.

I hope Google refrains from bullying website owners into making the internet a
worse experience for people without 1GB+ data plan.

~~~
niutech
No. AMP is much faster even without preloading. Here is an example of a random
article on CNN:
[https://www.webpagetest.org/video/view.php?id=180402_4583919...](https://www.webpagetest.org/video/view.php?id=180402_4583919a10f9cadcd56a6aacb67e6033c904cd34&data=1)

~~~
tscs37
This is not my experience. AMP is consistently slower than normal desktop
pages or mobile pages when offered. I've measured this myself on my own phone
countless times.

CNN is also probably one of the worst offenders, so the example is rather
cherry picked nor does it represent my usual browsing in any way.

------
madeofpalk
Heh. This reminds me of a recent pet peeve and observation of mine:
progressive web apps are not faster.

The Twitter Lite PWA, arguably the 'flagship' PWA ("developed in partnership
with Google"), takes longer to display tweets for me than regular desktop
Twitter.com, and the old 'static' mobile twitter site (which loads
INSTANTLY[1] you can only get with user agent trickery)

[1] Just did some testing. According to Chrome Dev Tools, old Twitter Mobile
displays tweets in 124ms. PWA Twitter takes greater than 1.4s (it stopped
recording screenshots), 2s according to a screen recording
[https://gfycat.com/PlushThornyIcefish](https://gfycat.com/PlushThornyIcefish)

~~~
Veen
PWAs aren't literally faster — caching aside, they load the same data and it
takes the same amount of time over the same connection. But there is a
percieved performance boost if the PWA uses caching and preloading
intelligently. The first load might take a little longer, loading the first
tweets will take just as long, but scrolling through the timeline should be
faster and page transitions can be almost instantaneous.

~~~
madeofpalk
Okay so this actually goes straight to the heart of everything that's wrong
with the web development communities obsession with PWAs. The technologies
behind PWAs are fine, but people need to learn how to properly assess these
buzzwords and learn if their suitable for the particular use cases of their
site.

The main use case of Twitter is to look at your timeline, yet Twitter Lite
somehow screwed that up and made it slower, even on subsequent loads. Not only
that, the particular implementation provides arguably a worse experience,
doing things like showing three different 'loaders' on the path to the
timeline (Twitter icon 'splash screen' (wtf, I thought this was all
preached?), spinner for the whole 'app', and then spinner for the timeline).

Reminds me a lot of people's obsession with Webpack and code-splitting - I'm
sure a huge majority of projects will find >75% of their JS bundle weight
being their dependencies.

------
stevew20
Don't use AMP... Aweful for everyone involved, except Google.

------
gerdesj
Is it really hard to use the whole of my screen? I'm well aware that modern
websites have to scale to lots of different screen sizes. My laptop is a 17"
job so why the blazes do I only get to see a block of text using the middle
third of it? It looks shit. I'd probably have to peek under the lenses of my
specs on a smaller screen. I spend far too much time using CTRL + these days.

~~~
rileyphone
See
[http://bettermotherfuckingwebsite.com/](http://bettermotherfuckingwebsite.com/)
for the reasoning behind this trend. Line width, namely the number of
characters shown in one, is regarded as a prime factor in readability, which I
personally agree with.

------
yorby
How fast could google.com be if they trimmed the JS fat?

~~~
niutech
The non-JS version takes 1/3 loading time of the JS version:
[http://www.webpagetest.org/result/180402_0J_6a3f29516e9a8bcf...](http://www.webpagetest.org/result/180402_0J_6a3f29516e9a8bcf06484a975136d3b7/)
vs
[http://www.webpagetest.org/result/180402_Z3_1bd3e53e1be2668c...](http://www.webpagetest.org/result/180402_Z3_1bd3e53e1be2668cb583ba24bdd54c3a/)

~~~
yorby
Thanks. And I have a feeling that it would be much worst (aka better) for a
mail.google.com inbox page, even if you keep the useful Javascript. But their
javascript is so obfuscated that it is not too easy to test. One time I
extracted a simple feature for gmail's javascript... it was fun (probably
would be easier for a programmer though)

~~~
throwaway2048
gmail has a basic html mode that is lightning fast.

------
wemdyjreichert
As someone with limited mobile data, not cool, Google. This after Google
created a cell carrier for people who use less data (Project Fi) and want per-
gb billing.

------
soulchild37
Alternate answer : not as fast as Dan Luu website.

[https://danluu.com/](https://danluu.com/)

~~~
tuananh
it's a pain to read it on desktop without reader mode. the width is just too
wide.

~~~
zokier
I'd put the blame on crappy user-agents that can't present a readable view by
default for a reasonable, semantically marked up document. Arguably that is
their raison d'être, and they fail horribly at it.

------
vemv
Worth noting that it would be insane to preload content that didn't pass a
strict filter akin to that of AMP.

Each Google search would download dozens of MBs and produce a significant CPU
workload, both resources being precious on mobile.

Perhaps it was a communication issue: AMP should have been named/marketed
"preloadable pages" rather than "fast pages".

~~~
niutech
AMP is not about preloading in the first place. It's about the fast CDN. Let's
compare any NYT article in the AMP and standard HTML formats:
[https://www.webpagetest.org/video/view.php?id=180402_16d7083...](https://www.webpagetest.org/video/view.php?id=180402_16d708376305a3bcdf0026043845ac4b232d0a17&data=1)
\- AMP loads much much faster.

~~~
vemv
Not sure of what does webpagetest is showing evidence of. It could be
anything... for one thing, AMP versions are much leaner so naturally they will
load fast - even with no dedicated CDN at all.

Cloudflare and Fastly should be more than sufficient CDNs?

Admittedly, maybe the AMP CDN is an easier one to set up for the masses, but
other than that I bet they all have about the same performance.

------
zestyping
Please stop saying "performant" when you mean "fast". If you just mean "fast",
say "fast".

------
kyberias
Maybe just once tell the readers what AMP stands for.

~~~
niutech
AMP stands for Accelerated Mobile Pages.

------
gorhill
One detail which I feel must be mentioned: if you block `ampproject.org` by
default -- directly or by blocking 3rd-party javascript by default, -- you
will be "punished" with a 8-second delay before the page becomes visible.

This is an entirely artificial delay, implemented through an inlined style CSS
animation in AMP-based pages:

    
    
        animation:-amp-start 8s steps(1,end) 0s 1 normal both}
        @keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}
    

I can't see any good reason for such delay. If you are not aware of this 8s
delay, you might be misled into thinking the page is broken and that
`ampproject.org` is really needed, while the page renders just fine without
it, except for the delay.

Example: [https://ampbyexample.com/](https://ampbyexample.com/)

~~~
Ajedi32
I'd assume that's probably done to prevent FOUC while it's waiting for the JS
to load. What do you get if you override that style?

~~~
gorhill
If using uBlock Origin, you can try the example page with that cosmetic
filter:

    
    
        ampbyexample.com##body:style(animation: none !important;)
    

One thing for sure, the result is much more pleasant than having to wait 8
seconds if one does not want to un-block 3rd-party javascript from
`ampproject.org`.

~~~
lgats
I suppose webmasters could add the inline css

    
    
       body{animation:none !important;}
    

On mobile so I haven't had the chance to test

~~~
gorhill
I should have included this in my first comment: this is a requirement from
AMP to include the animation[1]:

    
    
        AMP HTML documents must contain the following boilerplate in their head tag. [...]
        <style amp-boilerplate>body{-webkit-animation: ...
    

[1] [https://www.ampproject.org/docs/fundamentals/spec/amp-
boiler...](https://www.ampproject.org/docs/fundamentals/spec/amp-boilerplate)

------
seanwilson
I think the point of AMP is it gives Google a simple and reliable way to
detect fast rendering pages that render well on mobile in a way that can't be
easily gamed. When you allow unrestricted usage of JavaScript that's changing
page content, loading styles etc. for example, detecting pages like this is
more difficult.

You can write performant pages without AMP but how would Google reliably
detect pages like this?

I'm not saying AMP is the best solution and I can see why some developers have
objections against it but I think I understand what it's trying to do.

~~~
JoshMnem
> I think I understand what it's trying to do.

It's appifying the WWW on Google's domain and allowing them to dictate how
sites are monetized. On the most basic level, it isn't motivated by speed.

~~~
fastball
Fast page loads means a better UX on the web.

Better UX on the wide web means people enjoy using Google more. If I'm using
Google, it means I want to find something. If Google has encouraged the entire
web to be faster, I will find what I'm looking for faster.

People using Google and enjoying it is good for Google.

~~~
JoshMnem
> Fast page loads means a better UX on the web.

Not necessarily. AMP has terrible usability. For people who block 3rd party JS
from loading, AMP pages take 8 seconds to load.

AMP will hurt publishers in the long run:

\- giant back button to take users back to Google Search instead of deeper
into your site

\- broken referrers

\- bad inbound links (that point to google.com)

\- someone else dictates your monetization strategy

\- someone else limits how you publish online

\- not faster than DIY optimization

\- etc.
[https://www.google.com/search?num=100&q=amp+sucks](https://www.google.com/search?num=100&q=amp+sucks)

------
whyagaindavid
I built a simple bash/javascript to get the AMP URL for a given URL, did
reduce my data usage by tons. Look here:

[https://developers.google.com/apis-
explorer/?hl=en_US#p/acce...](https://developers.google.com/apis-
explorer/?hl=en_US#p/acceleratedmobilepageurl/v1/acceleratedmobilepageurl.ampUrls.batchGet)

    
    
       curl -X POST -H "Content-Type: application/json"  -d "{urls: ['$1'] }" 
       https://content-acceleratedmobilepageurl.googleapis.com
       /v1/ampUrls:batchGet?key=YOUR_AMP_API_KEY
    

For android app use:

    
    
           public static String GET(String url){
            String result = "";
            String ampString = "https://content-acceleratedmobilepageurl.googleapis.com/v1/ampUrls:batchGet?key=YOUR_AMP_API_KEY";
            HttpURLConnection conn = null;
            try {
                URL ampurl = new URL(ampString);
                conn = (HttpURLConnection) ampurl.openConnection();
                conn.setReadTimeout(10000);
                conn.setConnectTimeout(15000);
                conn.setRequestProperty("Content-Type", "application/json");
                conn.setRequestMethod("POST");
                conn.setDoInput(true);
                conn.setDoOutput(true);
    
                JSONObject jsonObject = new JSONObject();
                jsonObject.accumulate("urls", url);
    
                OutputStream os = conn.getOutputStream();
                os.write(jsonObject.toString().getBytes("UTF-8"));
                os.close();
    
                InputStream istream = null;
                istream = conn.getInputStream();
                InputStream in = new BufferedInputStream(istream);
                if(in != null){
                    result = convertInputStreamToString(in);
                }
            }
            catch (Exception e) {
                Log.d("News exception", result);
            }finally {
                // Close Stream TODO
                // and disconnect HTTPS connection.
                if (conn != null) {
                    conn.disconnect();
                }
            }
    
        private static String convertInputStreamToString(InputStream inputStream) throws IOException {
            BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream));
            String line = "";
            String result = "";
            String id = "";
            String ampUrls = "";
    
            while((line = bufferedReader.readLine()) != null){
                result += line;
            }
            inputStream.close();
            try {
                JSONObject jsonObj = new JSONObject(result);
                // check if jsonObj has ampUrls string - how to do it?
    
                    if (!jsonObj.isNull("ampUrls")){
                        JSONArray contacts = jsonObj.getJSONArray("ampUrls");
                            for (int i = 0; i < contacts.length(); i++) {
                                JSONObject c = contacts.getJSONObject(i);
                                id = c.getString("cdnAmpUrl");
                                }
                        }
    
                } catch (JSONException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            return id;
    
        } //end of convertInputStreamToString

~~~
niutech
You can try the AMP Desktop Extension, which uses this API:
[https://chrome.google.com/webstore/detail/amp-browser-
extens...](https://chrome.google.com/webstore/detail/amp-browser-
extension/mccnchmofleakpdohkmljohfckgpdehb)

------
lern_too_spel
A very low quality article. The _whole point_ of AMP is to define a restricted
subset of HTML that is safe to prerender and still provide working analytics
to the publisher. When you prerender, the advantage of AMP is substantial as
it is impossible to beat a user experience of instant, which is why users
prefer it and why publishers go through the trouble of implementing two web
versions of their web pages (in addition to Facebook and Apple News non-web
versions).

The point of the AMP cache is not for CDN speed, as the author mistakenly
believed and measured, but for same-origin or CORS prerender, and Google is
not the only implementer.

~~~
millstone
Publishers go through the trouble in order to get the boost in Google's
rankings.

As an iOS user I find AMP to be quite buggy, and AMP versions of pages like
reddit are borderline non-functional. I don't prefer it at all.

~~~
what_ever
It's a trouble of writing template once though and it is not that much work. I
worked on this at my previous employer and it was alright, little frustrating
but once it was done, it was done until you redesign the pages.

Disc: Googler but nowhere close to AMP.

~~~
manigandham
It is absolutely not that simple. We are a marketing company working with
hundreds of publishers and this is a constant struggle.

It's splitting whatever little dev time they have on yet another format that
adds nothing to the already universally accessible "web" version.

------
Shorel
Answer: not as fast as the D lang forums.

[https://forum.dlang.org/](https://forum.dlang.org/)

~~~
rolae
Truly impressive is [https://www.gov.uk/](https://www.gov.uk/)

A government site, lightning fast, try the search! No bullshit design.

~~~
Nux
Yes, I'm always impressed when I have to deal with it. Truly amazing to find
such competence in a gov site.

A lot of that is done in the open, too.

[https://alphagov.github.io/](https://alphagov.github.io/)

~~~
flr03
The uk gov website is a blessing, now leaving in the UK I can compare with the
french ones and those are not playing in the same league.

------
majewsky
A suggestion for the author: Please avoid commas (or dots) as thousands
separators. My brain parses "4,604ms" as "about four milliseconds", which
would be amazing, but is very much not what you mean.

ISO recommends half-width spaces as thousands separators to avoid this kind of
confusion. Also, I think thousands separators can just be skipped if your
numbers are only four or five digits wide.

~~~
lostgame
>> Please avoid commas (or dots) as thousands separators.

You might as well say 'please ignore the standards of your country in favour
of mine.'

Are you really not aware that this is the standard in Europe?

~~~
larkeith
Parent is clearly a European (or denizen of another local that uses commas as
decimal markers), as they interpreted 4,604ms as slightly over 4ms. Also, they
advise using an ISO ( _International_ Standards Organization) standard,
specifically to avoid misinterpretation while remaining locale-independent.

~~~
hartator
I think the confusion is more about secondes vs ms. Like 4.604s parses easier
in my brain.

~~~
majewsky
No it isn't. Your parent comment was correct.

------
xenadu02
So basically Google could get 90% of what AMP provides without AMP itself,
because the magic is in the caching and forcibly reducing the ad junk the page
loads.

Does that about sum it up?

~~~
notatoad
Yes, except how do you propose to implement caching and stripping out the ad
junk without AMP?

~~~
endorphone
HN is seemingly incapable of rationally discussing AMP.

AMP solves a very real problem, which is that our web stack is open to
enormous abuse because it is sometimes too powerful for its own good. While we
could make simple HTML that is as fast ( _of course_ we can), the reality is
that we don't, and many don't often for tragedy of the commons reasons. And
the counter-argument that search rankings should just favor this -- e.g. just
promote speedy pages -- ignores that abuse would be absolutely rampant (and
the other argument -- just run a layer of ad blockers -- completely misses the
point). AMP isn't just an ideal, it's a strict set of enforced restrictions.

In previous discussions I've noted that we need an HTML lite to counter AMP,
not just the same head-in-the-sand strawmen about how it serves no purpose. An
HTML lite that is a mode in the browser, enforced on the DOM and JavaScript.
The anti-AMP rhetoric makes it impossible to discuss rationally.

~~~
ForHackernews
> many don't often for tragedy of the commons reasons.

Google are some of the major culprits driving the creation of an unpleasant
web experience loaded with tracking and advertising cruft, and now they're
pushing this alternative format to supposedly fix the damage they wrought.
That's why people are salty about AMP.

It's an imperfect analogy, but imagine if some company had torn up the roads
near your house by driving their heavy cargo trucks over it, and now you're
irritated by the potholes, that same company says, "Great news! If you just
buy our special tires and shocks and install them on your car, you'll have a
smoother ride with fewer bumps from potholes!"

~~~
endorphone
Google has pushed speed in virtually everything they've done since day one.
Asynchronous, deferred scripts. Always outrageously fast loads. Simple,
lightweight ads. They even built a browser to try to push speed.

I despise ads, but blaming Google for the situation that we're in is seriously
missing the mark.

Google wants the web to succeed, for their own selfish reasons. They don't
want it to become a wasteland of zombie scripts, cryptomining, pop-overs, and
abuse (which tends to be even worse on mobile, as an aside, abusers knowing
that mobile users often have fewer tools). They have been pushing pro-web
policies since the early days. AMP, as cynical as people can be about it, is
one of those.

~~~
ForHackernews
Google monetized links. They were the ones who showed you could make serious
money from tracking and marketing to people on the internet.

Your argument is "Google is more technically competent at doing all these
crappy things than Google's imitators", but Google was the trailblazer who
proved there was big money in ads and scripts that do more than blink a
banner.

~~~
endorphone
No, that isn't my argument, and given that you're busy taking swipes at absurd
strawmen I think this conversation is done.

