OS X startup profiles show the main thread as both janky and idle while running OS code
Categories
(Core :: Gecko Profiler, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: florian, Assigned: mstange)
References
Details
Attachments
(1 file)
See this profile: https://perfht.ml/2wa4gqK (no symbols for XUL because this is from a try server build)
Markus, when spinning the native event loop like this, would there be a way to detect that we are no longer idle, and change the category?
Markus' bug 1616642 seems to be about the same issue, and you did respond there -- but it was 1 month ago, an eternity in this strange new world!
(Though in bug 1616642 comment 1 there, I said the idle label was not present in the Mac event processor, maybe I was wrong?)
Comment 2•4 years ago
|
||
Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3
(Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3
(normal.)
Reporter | ||
Comment 3•4 years ago
|
||
Here's another startup profile showing samples in the Idle category during times where we have jank markers: https://deploy-preview-3098--perf-html.netlify.app/public/n1xjww80h1d0092jjs2mrjk91j6mmhk8xq4j0jr/calltree/?globalTrackOrder=6-0-1-2-3-4-5&hiddenGlobalTracks=1-2-3&hiddenLocalTracksByPid=69480-0-3-4-5&localTrackOrderByPid=69480-7-8-0-1-2-3-4-5-6-9-10-11-12-13-14~69486-0-1~69481-0-1~69483-0-1~69485-0-1~69484-0-1~&range=1291m831&thread=0&v=5
There's no nested event loop in these cases.
Assignee | ||
Comment 4•4 years ago
|
||
The problem in this profile is that we don't have a function on the stack when the native event loop runs certain types of work, for example "CFRunLoop observers". So we don't have a function that could push a profiler label. But I think CFRunLoop has a way to listen for notifications when it changes between modes, for example when it starts and stops running observers. We could flip some state in those callback functions and somehow respect it during sampling (maybe by pushing a fake stack label?).
Assignee | ||
Comment 5•4 years ago
|
||
Actually, we can do the inverse: There are kCFRunLoopBeforeWaiting
and kCFRunLoopAfterWaiting
notifications, so we can remove our current IDLE label, and push/pop it from those notifications instead.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Assignee | ||
Comment 7•4 years ago
|
||
Florian, can you test the attached patch?
Reporter | ||
Comment 8•4 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #7)
Florian, can you test the attached patch?
Seems much better, thanks for working on this! Example profile.
Comment 10•4 years ago
|
||
bugherder |
Description
•