Window frame is painted way too often when scrolling the web content |
|||
Issue descriptionI was measuring the performance overhead added by Windows 10 custom titlebar ( bug 505013 ) and despite the fact that it's only adding ~0.3ms to a 2-3ms function (GlassBrowserFrameView::OnPaint) it's still showing up in performance tests. The opaque frame takes longer to paint (~4ms) and no one complains about that. It looks like we're painting the titlebar approximately every frame while scrolling a webpage. That seems wrong, since the titlebar is not changing at all. For reference, if you start a trace and do nothing, the titlebar is not repainted. I also noticed the titlebar was repainted if you waggle the mouse in the non-interactive tabstrip background, but that may be expected.
,
Apr 4 2018
I suspect that the titlebar repainting on mouse waggles is also unintended, or at least avoidable. Can you land your changes that add tracing events around the custom titlebar tracing? Is it possible to land equivalent events for normal titlebar painting when the custom titlebar is disabled? I assume not (since Windows is doing that), but ???
,
Apr 5 2018
I retested today and it looks like simply scrolling does NOT cause the titlebar to repaint, and neither does waggling the mouse over the non-interactive titlebar background. However, waggling the mouse over the active tab does cause it to repaint (even though nothing is changing). That means this might not explain the perf test regressions though, since I think they're using synthetic mouse events to scroll the page.
,
Apr 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8e297c1c23e884e7c49c6913b161b4c5361179f1 commit 8e297c1c23e884e7c49c6913b161b4c5361179f1 Author: Bret Sepulveda <bsep@chromium.org> Date: Fri Apr 06 01:46:59 2018 Add trace events to window frame code, to measure performance. Bug: 829137 Change-Id: I1bcce9e0a61d0528318d9c58814fba3de9377434 Reviewed-on: https://chromium-review.googlesource.com/998997 Reviewed-by: Bruce Dawson <brucedawson@chromium.org> Commit-Queue: Bret Sepulveda <bsep@chromium.org> Cr-Commit-Position: refs/heads/master@{#548635} [modify] https://crrev.com/8e297c1c23e884e7c49c6913b161b4c5361179f1/chrome/browser/ui/views/frame/glass_browser_frame_view.cc [modify] https://crrev.com/8e297c1c23e884e7c49c6913b161b4c5361179f1/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc [modify] https://crrev.com/8e297c1c23e884e7c49c6913b161b4c5361179f1/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
,
Apr 6 2018
,
Apr 11 2018
This is the first time I've used chrome://tracing, but it looks to me like there's a fairly fixed minimum of PaintTitlebar calls on the initial display of a tab and switching back to the tab recording the trace - on the order of 60.
,
Apr 16 2018
The vast majority of the paint calls are due to mousing over the title bar. If I start recording, use <cntrl> T to open a new tab, <cntrl> <shift> Tab to get to the about:tracing tab, and stop recording, I see 2 calls to LayoutTitleBar and 8 calls to paint. Using the mouse to switch to the about:recording tab causes ~45 calls to paint, which is consistent with what Bret described about waggling the mouse over the active tab. Moving the mouse over the app menu seems to generate 2 or 3 paints of the title bar, even though it's not part of the title bar. It looks like opening or switching tabs generates about 4 paints, so depending on what the performance tests are doing, I suppose it could show up.
,
Apr 16 2018
I think the critical question is whether the amount of repainting is varying depending on whether we have the custom title bar enabled - assuming that we can determine that. On the other hand, maybe that doesn't matter. If we own the title bar and if we are repainting it when nothing has changed then we should stop doing that. Maybe we have some logic that triggers repaints on every mouse move event instead of on every mouse move event that changes state. That would end up being a small but important performance regression.
,
Apr 16 2018
Turning off the custom title bar via the flag reduces the number of calls to OnPaint in both scenarios. <Cntrl> T <Cntrl> <Shift> Tab generates 7 calls to OnPaint and using the mouse to switch back to the previous tab generates ~31 calls to Paint instead of ~45. The former doesn't seem all that significant but the latter does, though 31 calls to OnPaint is still a surprising number. Specifically, mousing over tabs generates a lot of OnPaint calls. Mousing elsewhere in the title bar doesn't.
,
Apr 18 2018
I ran the perf test in https://bugs.chromium.org/p/chromium/issues/detail?id=825814 locally, with GlassBrowserFrameView tracing added to the benchmark tracing, and GlassBrowserFrameView::OnPaint is only called 5 times, so I doubt that perf test regression is due to the window frame getting painted more.
,
Nov 22
***Mass UI Triage*** As per dev comments adding related labels for further triage.Thanks! |
|||
►
Sign in to add a comment |
|||
Comment 1 by bsep@chromium.org
, Apr 4 2018