How to interpret gaps in chrome flame charts

不想你离开。 提交于 2019-11-30 17:36:34

问题


I'm trying to better understand how to interpret chrome flame charts.
In the below chart _changeHandler is shown as four distinct blocks. However I know for fact that it's only being called once.

I saw a similar question here, which claims this might be a bug, but that was four years ago:
What are this gap mean in Chrome devtools profile flame chart

Question:
In which case would chrome perf tools show gaps in the flame chart for the same function call ?

The real problem is that it really invalidates the entire graph. The bottom of the graph fragments but the top parts are the same function. I can't figure out how to make sense of that at all.

When using cpu throttling, the problem becomes exponentially worse. Look at the second picture, it's the same operation as the first graph, but with cpu throttling set to 5x slowdown.
The fragmented bar under "Function Call" is a single function call, for some reason it's fragmented in hundreds of sections.


回答1:


Thing is, we get the JS function data by sampling (unlike native events that we get by instrumenting start/stop). So internally it's just 4 samples that landed into the said function. We don't know if it was executed once or 4 times or 100 times, but we do our best to glue them so as it appeared as one call as long as the samples are adjacent.

But sometimes this logic mysteriously fails. Most of the time, this is because of some problems while sampling the JS stack (if some inlined or native function is on top, we sometimes fail to unwind the stack properly).

Source: Chat with a DevTools engineer

If you want to privately submit a url / steps to reproduce, the team can check it out. They thought they fixed this category of bugs.



来源:https://stackoverflow.com/questions/46008547/how-to-interpret-gaps-in-chrome-flame-charts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!