Current time: 09-19-2020, 06:11 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Late Start Render Time - What is blocking?
08-07-2014, 04:02 AM (This post was last modified: 08-07-2014 04:05 AM by BITS.)
Post: #1
Late Start Render Time - What is blocking?
I built up a test environment to test some optimization techniques. At the moment I try to find out why the Start Render Time is at about 0,7 seconds in the following example:

[Image: StartRenderTime.png]

Link: http://www.webpagetest.org/result/140806...1/details/

To exclude JavaScript as the source of Render blocking I used the WebPagetest blocking feature.

In my opinion the browser should start rendering the site at about 0,4 seconds because I see no reason to wait another 0,3 seconds till 0,7. Any ideas what can cause the blocking behaviour?
Find all posts by this user
Quote this message in a reply
08-07-2014, 10:36 PM
Post: #2
RE: Late Start Render Time - What is blocking?
I think you're starting to get into the realm of the performance for the browser itself.

There are probably a couple of things going on:

1 - The video capture is every 100ms so it could have been anywhere between 0.601 and 0.700s.

2 - Browsers tend to try to conserve work and not paint too often (finding a balance can be difficult). As long as it has work to do (building the tree, applying styles, etc) it might decide to defer rendering for a little bit (I know Chrome has a escape on the tokenizer after doing 250ms of work for example - not sure about Firefox's logic).

3 - Actually drawing the content can sometimes take a significant amount of time and getting it to the GPU and out to the screen is also not trivial.

On top of that, for Chrome anyway, there is a bug that is in the process of getting fixed where a page with only external css in the head and no script tags holds off rendering for a lot longer than it should: http://crbug.com/401087

For the most part you are doing a lot of things right and it's really up to the browsers to find a better way to get as much of the content to the screen as early as possible without otherwise slowing down the user experience.

The one opportunity that I do see is that if you inline the above-the-fold CSS you could improve the start render pretty significantly (or at least give the browsers the chance to improve it).
Visit this user's website Find all posts by this user
Quote this message in a reply
08-07-2014, 11:39 PM
Post: #3
RE: Late Start Render Time - What is blocking?
Thanks Pat, this helps me a lot. Another example for the Browser behaviour you described in 1-3 (not Chrome) is the following test: http://www.webpagetest.org/result/140807_JE_MAQ/

E.g. the Fully Loaded Time for the repeat view is 0.194s and the browser starts rendering at 0.295s. The Start Rendering Time for the First View (0.598s) is also behind the Fully Loaded Time of 0.526s.

I will try to inline all the above-the-fold CSS to investigate how the Start Render Time will be influenced.
Find all posts by this user
Quote this message in a reply
08-07-2014, 11:47 PM
Post: #4
RE: Late Start Render Time - What is blocking?
When you inline the above-the-fold CSS make sure to move the external css down to the end of the body or somewhere where it won't block the browser's processing.

As a quick hack just to see if it helps you can inline all of the CSS. You won't get all of the benefit because it'll be pretty big but it should give you an idea if it will work.
Visit this user's website Find all posts by this user
Quote this message in a reply
08-08-2014, 01:34 AM (This post was last modified: 08-08-2014 01:34 AM by BITS.)
Post: #5
RE: Late Start Render Time - What is blocking?
This is the result with inline all of the CSS: http://www.webpagetest.org/result/140807...1/details/

A little improvement. Start Render Time is now at 0.608s instead of 0.699s.
But it is still far away from the end of downloading the html (with css) which happens at 0.3s.
Find all posts by this user
Quote this message in a reply
08-08-2014, 01:45 AM
Post: #6
RE: Late Start Render Time - What is blocking?
FWIW, Chrome does a pretty good job at rendering it as soon as it can: http://www.webpagetest.org/video/compare...G3-r:1-c:0

I think you're into browser-specific pipelines at this point (though figuring out what blocked the text from rendering right away in Chrome would be good).
Visit this user's website Find all posts by this user
Quote this message in a reply
08-12-2014, 12:22 AM (This post was last modified: 08-12-2014 12:26 AM by BITS.)
Post: #7
RE: Late Start Render Time - What is blocking?
(08-08-2014 01:45 AM)pmeenan Wrote:  FWIW, Chrome does a pretty good job at rendering it as soon as it can: http://www.webpagetest.org/video/compare...G3-r:1-c:0

I think you're into browser-specific pipelines at this point (though figuring out what blocked the text from rendering right away in Chrome would be good).

I tried a few things to get closer to a solution but without success:

1) Disabled all plugins in WordPress
2) Found that the genericons.css loads an inlined font via @font-face, so I kicked the complete file out (it's still available but empty)
3) Removed all inlined images from the css-file to exclude the inline images as the route of failure

A few more tests in Firefox:
Just HTML + CSS: http://www.webpagetest.org/result/140811...1/details/
HTML + CSS + 2 Pictures: http://www.webpagetest.org/result/140811...1/details/

As soon as I add pictures the StartRender Time is shifted backwards.

I also did the tests in Chrome:
Just HTML + CSS: http://www.webpagetest.org/result/140811...1/details/
HTML + CSS + 2 Pictures: http://www.webpagetest.org/result/140811...1/details/

Is there any possibility in Chrome to dive into the generation of the CSSOM (or after that) to find out where the time is "lost"? Does the "DOM Content Loaded" event also include the CSSOM?
Find all posts by this user
Quote this message in a reply
08-14-2014, 03:44 AM
Post: #8
RE: Late Start Render Time - What is blocking?
You will need to capture a Chrome trace to figure out where the time is going (chrome tab in the advanced settings).

"DOM Content Loaded" is just the point when the HTML parser has reached the end of the document which means it has executed any blocking scripts. The CSSOM may not be complete yet.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 4 Guest(s)