Closed
Bug 587887
Opened 15 years ago
Closed 15 years ago
Refresh driver timer should be 60Hz and TIMER_REPEATING_PRECISE
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: roc, Assigned: roc)
Details
Attachments
(2 files, 1 obsolete file)
|
3.80 KB,
patch
|
dbaron
:
review+
benjamin
:
approval2.0+
|
Details | Diff | Splinter Review |
|
1.13 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
Comments on my blog suggest that 60Hz is a better guess for the refresh rate, and being higher than 50 it's slightly more "conservative" if we guessed wrong.
I also think that the timer should be TIMER_REPEATING_PRECISE for a steadier frame rate. Is there a problem with starvation there? I would hope that under load timer events don't get any special priority.
| Assignee | ||
Comment 1•15 years ago
|
||
Patch is trivial, if this is the right thing to do
Assignee: nobody → roc
Attachment #466506 -
Flags: review?(dbaron)
If refreshes are expensive, it seems better to leave some processing time to other things; that was why I originally chose TYPE_REPEATING_SLACK rather than TYPE_REPEATING_PRECISE. That said, I think we should actually experiment with how things behave under heavy load to see what works better. I think we should probably experiment with the refresh rate at some point as well.
(It might be worth have a boolean and an integer pref to allow people to experiment, though we might want to clamp the integer to be at least 10.)
That said, I'm fine with trying this.
Attachment #466506 -
Flags: review?(dbaron) → review+
| Assignee | ||
Comment 3•15 years ago
|
||
Actually I think having prefs is a fine idea. A pref for the rate actually might be useful to someone. I'll do that.
| Assignee | ||
Comment 4•15 years ago
|
||
Attachment #466506 -
Attachment is obsolete: true
Attachment #466534 -
Flags: review?(dbaron)
| Assignee | ||
Comment 5•15 years ago
|
||
That patch also changes the default rate to 60Hz, but doesn't flip the "precise" pref, because that change is somewhat more risky.
| Assignee | ||
Comment 6•15 years ago
|
||
Attachment #466535 -
Flags: review?(dbaron)
Comment on attachment 466534 [details] [diff] [review]
Add prefs
r=dbaron
Attachment #466534 -
Flags: review?(dbaron) → review+
Comment on attachment 466535 [details] [diff] [review]
Flip "precise" pref on
r=dbaron
Attachment #466535 -
Flags: review?(dbaron) → review+
| Assignee | ||
Updated•15 years ago
|
Whiteboard: [needs landing]
| Assignee | ||
Updated•15 years ago
|
Attachment #466534 -
Flags: approval2.0?
| Assignee | ||
Updated•15 years ago
|
Attachment #466535 -
Flags: approval2.0?
| Assignee | ||
Updated•15 years ago
|
Whiteboard: [needs landing] → [needs approval]
Comment 9•15 years ago
|
||
What happens if a particular frame takes more than 1/60 of a second? Does the timer then skip a frame, or do they back up? Is there a test to make sure we don't starve?
| Assignee | ||
Comment 10•15 years ago
|
||
mTimeout always advances by mDelay every time the timer fires, so if firings take longer than mDelay for a while, mTimeout will fall behind "now" arbitrarily far and events will be fired constantly. However, we shouldn't starve during this time because we're just posting events to the main thread and events are still processed in FIFO order.
But from looking at the code, later if we can process firings quickly again, we'll keep firing events as fast as possible until mTimeout "catches up" to "now".
That seems pretty broken, so I won't flip the precise pref for now.
| Assignee | ||
Updated•15 years ago
|
Attachment #466535 -
Flags: approval2.0?
Comment 11•15 years ago
|
||
Comment on attachment 466534 [details] [diff] [review]
Add prefs
ok. It sounds like we want some kind of "precise-skipping" timer.
Attachment #466534 -
Flags: approval2.0? → approval2.0+
| Assignee | ||
Updated•15 years ago
|
Whiteboard: [needs approval] → [needs landing]
Comment 12•15 years ago
|
||
For what it's worth, using a pref cache instead of calling the getter every time might be better, esp. in the e10s world. But that can be a followup bug...
| Assignee | ||
Comment 13•15 years ago
|
||
I sincerely hope in the e10s world each process gets at least a read-only copy of the prefs so every pref read isn't IPC...
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
| Assignee | ||
Comment 14•15 years ago
|
||
| Assignee | ||
Comment 15•15 years ago
|
||
This is probably responsible for a small Dromaeo DOM regression. When mozilla-central is not too busy, I'll try temporarily checking in a patch to lower the refresh rate to 50Hz again to check if the change in refresh rate is the cause of the regression.
You need to log in
before you can comment on or make changes to this bug.
Description
•