How fast is AMP really?
timkadlec.com
timkadlec.com
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/
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`. body{animation:none !important;}
On mobile so I haven't had the chance to test 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...One example is that the youtube mobile website will prevent you from playing a video in the background now. It didn't used to. This is to "encourage" you to use their Youtube RED app.
Source of the site is here: https://github.com/CyberShadow/DFeed
Also, it runs on SQLite. I found that the most surprising of all.
Web development in D is incredibly fun. I love that I can compile HTML templates into machine code (which of courses catches template errors as compiler errors), I love how fast the result is, I love that there is a very lively collection of D packages around web development. In fact, the D package manager, dub, started as a package manager for Vibe.d, the main D web framework.
I presume it was because prior to my comment, no one had yet explained to the guy that you don't need to deal with such a proxy setup to block ads in browsers.
So, your comment sort of made it sound like ad blocking not being too great for him, was because of Firefox and that Brave would be better at it, whereas it really just was because of a missunderstanding of the guy.
Besides that, Brave is also controversial. As much as some people have screamed bloody murder, because Eich's free speech was supposedly taken away by journalists/SJWs/Mozilla or whoever, a good other percentage of people do think that his donation was wrong and that he should have reflected on it and distanced himself from this (past) opinion.
Furthermore, many people think him basing it on Chromium was wrong. No matter how pissed off he might've been at Camp Mozilla, and no matter how much journalists would've slandered him again, if he started supposedly trying to work with Mozilla again by starting a fork of Firefox, there's just no way that you can work for 17 years on anything and then a few months later go "Actually, this competing product is better".
Chromium being Google software and him trying to sell his Chromium-based browser as privacy-friendly does not help it either. There's millions of lines of code in there with tens of thousands of design decisions, all made by the biggest data broker on the planet. You're not patching all of those out in any reasonable time frame.
Chrome is faster than FF with real world applications.
Might be Chrome pre-loading content that's behind links, which Firefox doesn't do for security, privacy, battery and not-eating-all-your-RAM-ery reasons.
I tried enabling preloading in about:config, which didn't seem to make a difference, but I'm not sure, if I did that right or if that feature is even functional at the moment. It's an experimental about:config flag after all, not a production feature.
Then again, this very much seems to be the exception on Chrome, too, so it's not exactly a reason to stop enjoying the internet without ads.
Aside from making pages with few database queries, it's about removing all 3rd party dependencies and going same-origin to speed up the front-end too.
The 2 biggest things that slow me down are auth and analytics, but on the latter I trust you use an adblocker, and for auth I have a plan.
Sadly it seems you can't register new accounts anymore because of their merger(?) with VisualPing, but their old site still functions for those with accounts and the speed is mindblowing as you can see there. I feel every website should strive to be like this.
1. Plain, small html - page size is 6.1 kb (request took 700ms for me, I guess the server side rendering is pretty fast too), css file 11kb; note html, css and js are all properly minified
2. Font-awesome and jquery at the bottom of page to not block page rendering, both loaded throught cdn (although a fallback jQuery exists)
3. Site's own js is only 5.6k
4. No large static assets, only image on page is an svg dlogo
5. Did not check with js off, but saw hints of decent fallbacks for no-script
A government site, lightning fast, try the search! No bullshit design.
A lot of that is done in the open, too.
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.
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.
Does that about sum it up?
now, seriously, I do that just fine with an ad blocker.
(I work at Google but not in search so I could be wrong but I believe they talked about this during orientation)
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.
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!"
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.
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.
this is essentially what the AMP team is building - there's a few proposed standards that have come from AMP, with respect to making pages cacheable and pre-renderable.
The AMP project isn't pretending they're bringing something unprecedented to the web... they're very open about the fact that most of the things you need to do to make your site "AMP compatible" are just speed-conscious best-practices (like only using CSS transitions that have hardware acceleration, or async loading of assets).
"The project enables the creation of websites and ads that are consistently fast, beautiful and high-performing across devices and distribution platforms."
"Web pages and ads published in the AMP open-source format load near instantly, giving users a smooth, more engaging experience on mobile and desktop."
That's directly from the AMP's project site. Those statements are half-truths at best.
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
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.
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".
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.
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.
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.
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.
Disc: Googler but nowhere close to AMP.
It's splitting whatever little dev time they have on yet another format that adds nothing to the already universally accessible "web" version.
I work for a major news publisher. Rendering is tied to legacy systems with esoteric business logic, journalists could embed any one of hundreds of first or third party embeds, and many pieces of content embed arbitrary HTML directly. It seems crazy, but this is how a lot of news organisations are dealing with content.
AMP is designed to fail on any error, is incompatible with existing HTML and CSS, and to do CSS inlining right means completely rewriting existing build pipelines.
In a Google world implementing AMP wouldn’t be that hard; code is generally high quality and you control the stack. In media organisations responsibility for domains might extends between different (poorly communicating) teams and many critical components are handled by third party systems. Doing something simple like implementing AMP’s custom CORS logic was a nightmare.
Building an AMP site is not hard. Building an AMP site that runs on legacy publishing systems IS hard. This is something the AMP team should understand, but they seem incapable of accepting any sort of feedback.
At other times, well, it's possible that it might be the best experience for the user to have information presented to them immediately. It's definitely negative for people whose entire business model depended on those clicks, though. I understand their pain, fear, and anger.
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.
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.
So you think Google has no interest in making search results load faster and this factor is just a ploy?
You have evidence of these two claims or you're speculating?
> We started working on AMP because we were seeing the mobile web feel clunky and slow, falling behind the tightly-integrated, highly-optimized user experiences that walled garden platforms can offer. Yet we also knew there wasn’t a fundamental technology problem: you could build great experiences on the web with the right knowledge, resources, and management support. Thus we set out to create a framework that would provide a well-lit path to building great web-based experiences: AMP would be well documented, easily deployable, validatable, and opinionated about user-first principles.
If the project was motivated by speed, it:
- wouldn't be implemented in a way that breaks Google's own speed guidelines
- would be implemented in a way that favours speed, not placing in search and inside Google's ecosystem
- would be open to input from the web community, not in through an entirely opaque process inside Google
How? How do you 'load' pages instantly without their search iframe hack?
See, they are not really optimised for speed. They are optimised for being pre-loaded from Google's CDN in search results. Or, as OP's article says: "the incentives being placed on AMP content seem to be accomplishing exactly what you would think: they’re incentivizing AMP, not performance"
Actually recently I wrote quite a long comment about what's wrong with AMP: https://news.ycombinator.com/item?id=16549828 that covers that, and more.
The only reason AMP is perceived to be fast/instant is because Google lies.
We have a mobile web where publishers are very bad at making websites. The fill them full of various trackers, ad networks, bad practices and slow them down. This is bad because it makes the web a bad experience on mobile and drives users into native apps.
Facebook and Apple 'realised' this as well and launched their own proprietary solutions for their native platforms (for slightly differing reasons): Facebook had Instant Articles and Apple had their News app, all entirely closed platforms operating outside of the 'web' and without Google. This is a fundamental threat to Google as a business.
If you're in Google's shoes, what do you do? The web standards just don't provide a compelling enough solution to compete with FB Instant Articles and Apple News, which get to leverage being native apps, defining their own formats (fun fact: Apple News articles are JSON!) and preloading content however they Desiree.
AMP was their solution - based on 'open web standards', combined with a shitty hack to preload content when coming from their search results. They said from the beginning their taking the efforts of their AMP project and proposing standards for it, and that's what they're doing.
You can't properly judge Google's AMP efforts without first looking at what they were up against from Facebook and Apple.
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.
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
The same way it reliable detects the content of the site and everything else. Take a snapshot and keep the latest history.
You can easily change the content on a page with javascript so Google still needs to load everything to get an accurate representation. Since there are plenty of tools already (including Google's own) that measure page loading speed, it would be trivial to combine them into a performance score for search rankings.
If speed was actually made into a strong signal, major websites would've become as fast as AMP within months.
Wouldn't benchmarking page speed accurately for all pages on a website for a variety of screen sizes on a regular basis cost significant resources? If it's so easy, why are they not doing this already?
What I meant about AMP is that when a page validates as an AMP page you know there's certain things it can and can't do. This makes the task of identifying performant pages significantly easier.
They aren't doing it because AMP gives far more data and keeps first party cookies because of the cached domain.
I don't think it's as simple as you make out at all. Compared to just downloading the HTML and checking its contents, this requires executing JavaScript and rendering content in an actual browser which is orders of magnitude slower and more resource intensive.
Google already has the tools to detect fast rendering pages, though they've more or less stopped talking about them after the introduction of AMP.
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.
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).
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.
(the bars are raw/cached/canonical, and the groups on the X axis are min/max/median/90th)
https://developers.google.com/apis-explorer/?hl=en_US#p/acce...
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 convertInputStreamToStringISO 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.
So, "1,234,567.890" becomes "1.234.567,890".
If all you have is "7.890" or "7,890", you need to know what system the author uses.
What the guy proposes is always using spaces as thousands separators, independent of the system you're in.
So, then it would be written as "1 234 567.890" or as "1 234 567,890".
The spaces are almost universally understood and don't collide with other meanings.
It would still be possible for someone to be confused, if you're at the decimal separator and write your regional separator there, but it would cut out half the confusion.
The proposal, however, does make the think about this: https://xkcd.com/927/, so I don't know if we'll ever come to a good solution :/.
Can you describe your experience with numbers? Are you a mathematician or in some other scientific field?
Also, it seems odd to make a request like this of a (seemingly) random author on the internet. It feels similar to making a demand to change writing style. (ie, oxford comma, em-dash, etc...) Do you think it's reasonable to ask someone else, for what seems to me, is a cultural or occupational perspective should be adhered to just because of an individuals momentary state of confusion?
Different countries and languages have different format of numbers. That's one of the most common issue in internationalization.
If you send a bill for a 5,000 dollars service, expect your international customers to send you back five dollars. The comma is broadly interpreted as the decimal separator.
https://en.m.wikipedia.org/wiki/File:DecimalSeparator.svg
Blue uses the dot, green uses the comma. By population dot wins (since India and China use the American style).
If someone wrote it in German or French and used the wrong decimal separator, then it's an error.
There are hard limitations in hardware and software that people have to live with. A keypad only has a dot key.
Western keyboards descended from an American layout that's missing the comma. It's common for comma users to use a dot instead, because they don't have a choice. Also, a lot of software will refuse the input even if they go out of their way to write a comma.
China and India have numerous languages with their own numeric representation. It's not really relevant. Don't think for a minute that there are any standard for the entire population.
However, confusion happens when non-native English speakers start using their native language's digit grouping and decimal symbols when writing in English. They should use the English scheme when writing in English.
I did not mean to tell you what language to use. You can write and converse in whatever language you please.
> I’m not going to isolate me from the world of non-native writers in favour of English sirs’ better understanding of digits.
It's not about which system is better, but it's about following the grammar and conventions of the language you are using. For example, would you knowingly use the wrong verb form in an English sentence just because it resembles the usage in your native language?
> Sorry for my tone if I got wrong feeling that your comment is arrogant.
I don't think it is possible for my tone to be arrogant in this regard since I myself am a non-native English speaker I meant no disrespect :)
American English is not equivalent to Australian English or Canadian English.
So which international customers are you talking about?
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?
It's the same reason I write dates YYYY-MM-DD, a habit I picked up after working in a large company with employees from all over the world. (Though I generally wouldn't request other people to use it as well)
This method is clear to all users, rather than confusing all of mainland Europe.