admin管理员组文章数量:1399992
I've been told that my script is blocking the main thread on my client's site.
It's marked as <script async...>
so it should not be a network block.
I ran the Chrome profiler and I don't really understand what I'm looking at, despite googling for explanations.
Here's a screenshot of the script in question:
I don't understand which part of the entire blue block is the "thread blocking part"
Here's the associated Bottom-Up
table:
From the first image, the "thin line" spans from around 500ms to around 900ms, which is around 400ms of time, but in the Bottom-Up table, it says the total "Evaluate Script" time is 184.5ms.
So can I assume the "blocking" time of the script should be taken from the Bottom-Up table, ing up to be 184.5ms?
I've been told that my script is blocking the main thread on my client's site.
It's marked as <script async...>
so it should not be a network block.
I ran the Chrome profiler and I don't really understand what I'm looking at, despite googling for explanations.
Here's a screenshot of the script in question:
I don't understand which part of the entire blue block is the "thread blocking part"
Here's the associated Bottom-Up
table:
From the first image, the "thin line" spans from around 500ms to around 900ms, which is around 400ms of time, but in the Bottom-Up table, it says the total "Evaluate Script" time is 184.5ms.
So can I assume the "blocking" time of the script should be taken from the Bottom-Up table, ing up to be 184.5ms?
Share Improve this question edited Jun 18, 2020 at 9:36 x00 13.9k3 gold badges20 silver badges41 bronze badges asked Jul 4, 2019 at 21:28 PGTPGT 2,0392 gold badges27 silver badges49 bronze badges1 Answer
Reset to default 6 +50On the first screenshot we are looking at Network section. You can read how to make sense of it here.
In short:- The left line is everything up to the
Connection Start
group of events, inclusive. In other words, it's everything beforeRequest Sent
, exclusive. - The light portion of the bar is
Request Sent
andWaiting (TTFB)
. - The dark portion of the bar is
Content Download
. - The right line is essentially time spent waiting for the main thread
So it's not about execution time.
- The left line is everything up to the
I myself don't pletely understand yet what the
Bottom-Up
tab of the Network section mean... Maybe it doesn't even have a direct connection to network request:The
Bottom-Up
tab only displays activities during the selected portion of the recordingduring doesn't necessary mean caused by.
But anyway it's probably not what you're looking for. Take a look at the Main section, right after the end of the network request when finally waiting for the main thread is over and it's free and ready to execute the script you'll probably see a long bar - that's the time when your script is blocking the main thread.
E.g look at the screenshot- First
lux.js
is loaded (from the cache in this particular case). - Then it waits for the main thread (from 3117ms until 3128ms).
- Then a
Task
starts (it is selected and pointed to with the small arrow, the big arrow points to the fact thatlux.js
is indeed begins its execution) - Some time is spent on
Compile Script
- And only then you can see a flame chart of script execution (in red circle)
You can read more about this on the same page here
- First
Also some extra info and insights on optimization an performance monitor usage can be found here and in subsequent articles.
本文标签: javascriptHow to read Evaluate Script timings in Chrome profilingperformance tabStack Overflow
版权声明:本文标题:javascript - How to read Evaluate Script timings in Chrome profilingperformance tab - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744203252a2595066.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论