-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove preload for AMP runtime again when boilerplate was removed #17
Comments
Interesting! Have we got any benchmarks? The xwp link unfortunately doesn't work. |
/cc @mehigh Do you have something that can be shared? |
Also adding @kristoferbaxter and @jridgewell for thoughts on this. |
With preload: Without preload: https://user-images.githubusercontent.com/367593/90236974-32c63800-de2c-11ea-91fc-dfc483913266.png The difference is visible in GPSI as well: without preload (speed index decreases to 1.5s and below): I've had this hunch after noticing the painting gets a speed penalty when preloading web fonts which are optional, hence tried this thing out when aiming towards the 100 :) |
Taking a look, thanks for the ping @sebastianbenz. |
Webpagetest comparing @mehigh's samples. |
A major issue with comparisons like this is the network variability. Here's another Webpagetest comparison. |
Would running this test against a GC storage instance provide more
consistency? This has Cloudflare CDN in front of a static Html file
delivered by a dedicated metal server.
I think doing an extreme test can either confirm or deny this... Like doing
a preload for a 2MB JavasSript async file vs just loading it async without
a preload. Would that make the difference more pronounced? A test can tell.
I can give that a spin tomorrow morning.
|
I think the first contentful paint might be a better metric, as that's what I observed to improve when running local performance audits (with throttling turned on). |
I've created a repo here where you can explore these modifications a little more cleanly. Adding a test for FCP would be quite easy. Here's the comparison for LCP. |
I did test a scenario where I'm preloading a script (a large 700KB random JS file) from the same domain to see whether there's a negative impact to FCP: Here's the webpage test where both tests had 0.850s and 0.871s first byte times - where a 0.2s delay for the first paint of the background color is observed And then another one with a 2.1MB random JS file The largest contentful paint is clearly pushed out by 2.6s (which minimises the inconsistent network behavior) And then I did a test with the largest contentful paint element being inlined to see if inline assets are also negatively impacted: The webpage test shows the first background paint happening shortly with 0.1s later vs. the baseline with no preload at all: The presence of a preload that's not absolutely necessary to be preloaded (there's no urgency attached to it) seems to have a negative impact on the Speed Index metric and mostly surrounding the fact that the paint of the body background happens sooner (giving the user the perception of 'stuff happening on screen faster'), while other metrics (FCP/LCP) only have a small negative impact when adding the preload to a JS asset. Also on the LCP aspect, as long as the element is to be downloaded from the network, the queueing can happen earlier unless there's a preload queuing something else sooner, and that's another reason I see why the LCP can be impacted. Thank you all for your thought around this topic. It's so bleeding edge and exciting to make the web faster 👍 |
Given that the test results all seem to indicate this to be a net positive change, I'd like to implement this for the PHP Optimizer. @sebastianbenz, @kristoferbaxter should I also open corresponding issues for the Go and JS versions of the Optimizer? |
We can run a more thorough experiment before moving forward. Will sync with team today on this. |
Are there any updates on this? |
Maybe @kevinkimball or @erwinmombay can run an AMP Cache experiment for this? Should be simple enough. |
@sebastianbenz @kristoferbaxter @jridgewell Any updates on this? It's looking like a promising change, so I'd love to implement this for the library and WordPress integration. |
I've prototyped this along with postponing the loading of scripts that aren't render-critical at ampproject/amp-wp#6182 (comment). |
There is no update beyond the need for statistical analysis at a large enough scale to validate results. If we choose to adopt this and other suggestions there are several changes required for systems that ingest AMP documents and validate them. |
We should move forward with removal for now, data suggests the origin performance can be better without, but the preload version from a cache will continue to insert and perform better with in that scenario. |
@westonruter found link to this from here https://wordpress.org/support/topic/preload-amp-runtime-2/#:~:text=1%20month%2C%204%20weeks%20ago - the issue which users face running AMP plugin is they get dings saying to add the preload here: https://amp.dev/page-experience/ Unless the test itself is updated not to prompt users on this, we're looping everyone back to then tell them to ignore it. |
@robin-scott The issue to fix this is ampproject/amp-toolbox#1256 |
Feature description
When the AMP boilerplate is removed by the SSR logic, preloading of the AMP runtime is less critical and it seems to slow down other assets that are of higher priority in that scenario.
The Optimizer should remove an existing preload for the AMP runtime again when the boilerplate was indeed removed.
This was originally reported by @mehigh for an XWP project.
/cc @sebastianbenz
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
ServerSideRendering
transformer and removes an existing AMP runtime preload iff the AMP boilerplate was removed.QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: