Closed
Bug 1225950
Opened 9 years ago
Closed 9 years ago
Observing vsync blocks on the main thread, resulting in user-visible delays
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: kats, Assigned: kats)
Details
Attachments
(3 files, 2 obsolete files)
4.04 KB,
patch
|
mchang
:
review+
|
Details | Diff | Splinter Review |
3.76 KB,
patch
|
mchang
:
review+
|
Details | Diff | Splinter Review |
1.38 KB,
patch
|
mchang
:
review+
|
Details | Diff | Splinter Review |
On Fennec, load http://people.mozilla.org/~kgupta/stall.html and wait a second or two. Then scroll down quickly. Note that as the toolbar slides off, the bottom content area is filled with white rather than more content. There's a big jank when it starts scrolling for real. The page ties up the main thread for 1 second at a time using a spinloop. If you start scrolling during this time, the Java UI thread works fine and slides the toolbar off, and requests a composite from the compositor. If this composite actually happened, the clip rect would be extended and so you wouldn't see the misplaced green square or white space at the bottom of the page. However, the composite doesn't actually happen because we don't get vsync notifications. That in turn happens because the ObserveVsync() call gets stuck waiting on the main thread before it can actually register the vsync listener. The main thread, of course is busy with the spinloop. This is a reduced test case but think it's the same root cause for behaviour I've observed on real-world sites as well such as nytimes.com - sometimes during page load the main thread is busy for a while and trying to pan during that time will result in jankiness.
Assignee | ||
Comment 1•9 years ago
|
||
Also note that in the STR above, by "scroll down quickly" I mean "put your finger down and aggressively drag the page once" rather than "fling". Your finger needs to be touching the screen for the dynamic toolbar sliding code to activate.
Assignee | ||
Comment 2•9 years ago
|
||
The attached ugly hack fixes the problem for me locally - basically if we get a second composite request without having a composite happen in between it will do that composite ASAP rather than waiting for a vsync. It means we get unaligned composites, but at least it's not blocked on the main thread for who-knows-how-long. There's probably a better way to do this, maybe using a counter or a timestamp instead.
Assignee: nobody → bugmail.mozilla
Assignee | ||
Comment 3•9 years ago
|
||
mchang, any thoughts?
Attachment #8689147 -
Attachment is obsolete: true
Attachment #8689157 -
Flags: review?(mchang)
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8689205 -
Flags: review?(mchang)
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8689206 -
Flags: review?(mchang)
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8689157 -
Attachment is obsolete: true
Attachment #8689157 -
Flags: review?(mchang)
Attachment #8689207 -
Flags: review?(mchang)
Comment 7•9 years ago
|
||
Comment on attachment 8689205 [details] [diff] [review] Part 1 - Remove useless argument, it's always true Review of attachment 8689205 [details] [diff] [review]: ----------------------------------------------------------------- Thx for the cleanup!
Attachment #8689205 -
Flags: review?(mchang) → review+
Updated•9 years ago
|
Attachment #8689206 -
Flags: review?(mchang) → review+
Updated•9 years ago
|
Attachment #8689207 -
Flags: review?(mchang) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/e02accb9bd8f https://hg.mozilla.org/integration/mozilla-inbound/rev/d0834f918188 https://hg.mozilla.org/integration/mozilla-inbound/rev/b35877f85b9e
Assignee | ||
Updated•9 years ago
|
status-firefox42:
--- → affected
status-firefox43:
--- → affected
status-firefox44:
--- → affected
status-firefox45:
--- → affected
Comment 9•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e02accb9bd8f https://hg.mozilla.org/mozilla-central/rev/d0834f918188 https://hg.mozilla.org/mozilla-central/rev/b35877f85b9e
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•