Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Network's Waterfall in Chrome Dev Tool to diagnose web rendering performance issue?

One of our web pages has a rendering performance issue, when the page is open, the spinner is freeze or loading very laggy, and after 6-12 seconds the page completes loading. So i'm using the Network's waterfall in chrome dev tool to diagnose the issue. But I got a few scenarios which i don't understand what happened.

In the following screenshots, all the resources for the corresponding page are loaded in a very short time, but the spinner is freeze for 6 seconds or 9 seconds, i'm not sure what is happening after the resources are loaded and before the page completes loading, maybe the spinner is in a wrong thread or gets blocked somehow? What is the means that i should use to find out the cause?

Scenario 1

1

Scenario 2

2

UPDATE

Network Screenshot

pic

Timeline Screenshot

pic

UPDATE

After checking the Event Log, i think the issue happens at Angular digest cycle, that endpoint response time should still be 780ms.

pic

like image 742
Zhemin Zhang Avatar asked Mar 05 '17 06:03

Zhemin Zhang


People also ask

How do I check the performance of a website in Chrome?

To access the Performance tab, navigate to the website you want to profile, then open Chrome DevTools by right-clicking and selecting Inspect. Select the Performance tab inside Chrome DevTools.

What is waterfall in Chrome DevTools?

WHAT EXACTLY DOES THE WATERFALL TOOL DO? The waterfall chart is also known as the waterfall graph. It provides you with a visual representation of how all the assets on your website load. This includes CSS, JavaScript, HTML, images, plugins, and third-party content.


1 Answers

Thanks for the detailed info. It'd be more helpful if you can link to the page, but I understand that's often not possible. I'll just provide some general data for people in the same boat. I don't know if I'll be able to completely answer this specific question, though.

In the Scenario 1 and Scenario 2 screenshots you can see that your resources are loading in 1 or 2 seconds. That's your cue that the issue isn't related to the Network.

So while this is a page load issue, it has nothing to do with the network.

In Timeline Screenshot you can see that your CPU usage is completely maxed out from about 1900ms to beyond 16000ms. So your page is forcing the browser to do a tremendous amount of work. This is probably in the JavaScript.

To diagnose this, I'd investigate the flame chart (under Main) which you can see in Timeline Screenshot. The longer the bar, the longer that function is taking to complete. Or, if you see a small function getting called thousands of times, that could be the cause. If you can optimize those calls, then you can get your page visually loaded faster. You can click Self Time header in the UPDATE screenshot to rank the function calls according to which took the most time.

Again, I don't know how helpful this answer is for this particular question, but I thought I'd try to rephrase the problem in a different, more general way.

like image 136
Kayce Basques Avatar answered Oct 30 '22 12:10

Kayce Basques