At first I thought it was maybe due to the way I was loading images, but after further testing on WPT and on real devices locally, I’m pretty sure there is something unexpected happening on the WPT iOS device.
I created two test pages to test my theory, one with an empty body and one with just the text “TEST” in the body. I ran both through WPT on the real iPhone. Here are the results:
It consistently takes ~2.5s between the time after the html file has downloaded completely and the text “TEST” is displayed in the filmstrip view.
It does the same thing on a more complex page between the time when it has enough content to start rendering and when it actually starts rendering, but I wanted to show with these tests that it wasnt anything else causing the delay.
Any idea why this is happening and how to get reliable iPhone tests?
I have since also tested on the other iOS devices and they exhibit the same issue.
When you do local testing is it with similar connectivity (slower usually) and with a clear cache? WPT just records the screen using Quicktime and I have never seen the recording not represent what the device itself was doing. I HAVE seen that Safari tends to like to delay rendering as long as activity is going on to avoid duplicate work (multiple layouts/paints) and assume it is just a difference in strategies between browsers.
When I test locally, I clear cache and use xcode’s network link conditioner with a custom profile to have roughly the same settings as used on WPT. (3g fast)
But if I understand things correctly, network speed doesnt matter because the issue happens after all network traffic is complete.
There should not be any activity because the only thing that it is downloading is an HTML file. The HTML does not include any other resources and essentially only contains
but WPT reports that it takes 2.5s to render the text “TEST” after the HTML has fully downloaded (consistently with multiple tests on each of WPT’s 3 actual ios devices). It shows up close to instant on all the devices I’ve tested on locally (ios simulator, iphone 6s, ipad air).
This is the entirety of the waterfall:
This isnt just the first line of the waterfall – it is the only line.
Note that by 0.5s document is complete, DOM is interactive, and all content has downloaded, yet start render doesnt happen until 3.1s.
Thanks for pushing on this. It looks like the video processing must be messing something up for the iOS tests and is measuring the time from the start of capture instead of waiting until the orange frame goes away.
Here is a test run with the original raw on-device video (below the filmstrip links): http://www.webpagetest.org/result/160808_JY_1e0a1847c14d991730a362487f92e177/
I’m working on tweaks to the visualmetrics script now to fix whatever broke and I’ll update when the fix is live.
Should be fixed now: http://www.webpagetest.org/result/160808_5A_5c5d96155ccffe8f9d9e6645bd8d0c6e/
Looks like it may still be taking ~250ms to layout/draw but that’s not entirely unexpected.