Scrolling lags due to long composites on mac
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
Performance Impact | low |
Tracking | Status | |
---|---|---|
firefox87 | --- | affected |
People
(Reporter: whimboo, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: perf, perf:responsiveness)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:87.0) Gecko/20100101 Firefox/87.0 ID:20210213095234
Sometimes I see lags when scrolling on TweetDeck. Here is an example:
https://share.firefox.dev/3de1PXf
As it can be seen composits can take up more then 30ms (some even show around 70ms). Most of the time seem to be spend in webrender::renderer::Renderer::render
to render the frames.
Reporter | ||
Comment 1•3 years ago
|
||
Meanwhile this happens on various pages and not only TweetDeck. I can also see it on Bugzilla for long bugs, and within the profiler. Interestingly after some activities like starting the profiler the issue is gone for a moment or within a tab, but then comes back.
I have never seen that before and wonder if that might be a recent regression.
Updated•3 years ago
|
Updated•3 years ago
|
Reporter | ||
Comment 3•3 years ago
|
||
Here another profile. Not sure if it's the same or not. But Firefox Nightly behaves kinda sluggish and that not only for scrolling but also when switching tabs. It feels like it takes up to 1s.
https://share.firefox.dev/3rTsAVc
As it looks like the Renderer thread is kinda busy, and long composites only occur at the very end of the recording. Nevertheless the function most of the time is spent in is the same as mentioned in comment 0.
Note that this issue comes and goes randomly. Didn't figure out yet how to reproduce.
Comment 4•3 years ago
|
||
The time is spent waiting for the window server, I think. Or maybe for the GPU. It could be caused by having lots of windows open, system-wide. Or maybe we're leaking something. You could check the output of ioclasscount
when it's good and when it's bad and see if there's a pattern, maybe... Or you could take an "all processes" profile with Instruments and see what's keeping the window server busy. Or you could take a Metal System Trace of Firefox with Instruments and see if there's something that's keeping the GPU busy.
Updated•3 years ago
|
Reporter | ||
Comment 5•3 years ago
|
||
Lets see what I can do when this happens again. Are there any special classes I should focus on for the ioclasscount
command? It's a ton of output.
Comment 6•3 years ago
|
||
yeah it's a lot :(
Maybe you can find a correlation by comparing a good case to a bad case.
Using Instruments probably has higher chances of success.
Reporter | ||
Comment 7•3 years ago
|
||
I haven't had the time to look closely yet, but I noticed an interesting case:
The sluggish behavior was noticeable on a Bugzilla page. So I tried to switch to Instruments to do a recording, but then noticed that at this time the Firefox Nightly update notification was displayed, and got opened a couple of seconds before. When I then closed the notification, everything was fine again. No lags in scrolling anymore.
I don't know how to trigger this notification and as such will wait once it opens again before doing more investigation. But maybe the above finding already helps to find the causing issue.
Reporter | ||
Comment 8•3 years ago
|
||
The update notification might have been a red herring. I noticed the problem yesterday again, and I tried to catch it in Instruments. But switching over to Instruments, starting the recording and coming back to Firefox immediately to perform some scrolling the lags weren't no longer reproducible. I'll keep observing the behavior.
Updated•3 years ago
|
Reporter | ||
Comment 9•3 years ago
|
||
Meanwhile I have seen this behavior a couple of times, mostly kinda random. And whenever it started to happen, and I switched to another application also Firefox was behaving correctly again afterward in all those cases. That means that I cannot use Instruments to record a profile and check what the WindowServer is doing.
Markus, do you have any suggestions?
Updated•3 years ago
|
Comment 10•3 years ago
|
||
If you explicitly make FF not the standard-browser, but let it check for this on startup, then you'll get a reproduceable and predictable notification.
The other idea would be, to load a page with embedded javascript for "alert('hello world')" ...
Updated•2 years ago
|
Updated•2 years ago
|
Comment 11•10 months ago
|
||
In the profiles I can see the main thread spending time in CA::Transaction::observer_callback
so I think this got fixed by bug 1690687 and bug 1734705.
Description
•