Closed Bug 1380787 Opened 7 years ago Closed 3 years ago

fennec does not run rAF or rIC callbacks at 60fps unless screen is touched, part 2

Categories

(Firefox for Android Graveyard :: General, defect, P5)

defect

Tracking

(fennec?)

RESOLVED INCOMPLETE
Tracking Status
fennec ? ---

People

(Reporter: kats, Unassigned, NeedInfo)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1378966 +++

STR (from original bug, with modifications):

1. Open this site in fennec https://timer-flood.glitch.me/
2. Do nothing and just wait for the numbers to stabilize
3. Observe that they are at less than 60fps
4. Tap the screen somewhere
5. Observe that the rAF and rIC numbers increase to ~60 fps for a short time after tapping

I have no explanation for why tapping the screen would allow us to run requestAnimationFrame faster.

I don't observe this behavior on desktop, so filing under fennec for now.

Bug 1378966 has some investigation and a patch which helped somewhat but didn't fix the issue entirely.
The patch for Bug 1378966 has greatly improved the rAF on my test device. I previously reported it was fluctuating between 57-60Hz. That was with a debug build. With an optimized build it seems to bee much more in line with 60Hz. The rIC how ever did not change even with the optimized build and still runs around 40Hz. Tapping on the screen will bring the rIC up to 60Hz.
I believe our idle dispatch does some kind of prediction of time-till-next-frame.  If we are firing refresh driver too fast, then perhaps that is confusing the idle dispatch code.  Bug 1378966 comment 12 claims its firing at 80fps.

Olli, what do you think?
Flags: needinfo?(bugs)
With the patch on bug 1378966 I don't think it should be firing at 80fps any more. (As per the comment you referenced, once we stop double-incrementing the mPendingTransaction counter, we should stop setting mWaitingForTransaction to true, which means the DidComposite messages should stop ticking the refresh driver - therefore only vsync will tick the refresh driver, at 60Hz.)
Thanks.  I misunderstood.  Perhaps we just really don't have that much idle time.  Maybe a new profile is in order.

Snorp, can you take a new profile with your setup when you get a chance?  (I'm leaving for PTO shortly...)
Flags: needinfo?(snorp)
(In reply to Ben Kelly [reviewing, but slowly][:bkelly] from comment #4)
> Thanks.  I misunderstood.  Perhaps we just really don't have that much idle
> time.  Maybe a new profile is in order.
> 

Not having enough idle time does not explain why rIC goes to 60Hz when tapping on the screen.
I can't think of any reason why rIC would change when tapping.
Do we have some code using user-interaction-active for something relevant?
Flags: needinfo?(bugs)
Seems like ~60% of the time in the main thread is idle. I don't know how rIC is triggered so I don't know what rate is expected under these circumstances.
If the next refresh driver tick or next timer is about to fire soon, rIC won't be called.
You may want to play with idle_queue.min_period and layout.idle_period.time_limit.


There isn't any requirement that rIC should get called 60hz. In fact, rIC callback may never get called.
The profile in comment 7 shows 16ms to 18ms rasterizes.  For example:

  https://perfht.ml/2gQnolr

That seems pretty bad to me.  I mean, this site is not doing much actual work.  Is there a graphics issue here?
Or are we over-drawing for some reason?
(In reply to Ben Kelly [PTO, back July 24][:bkelly] from comment #10)
> The profile in comment 7 shows 16ms to 18ms rasterizes.  For example:
> 
>   https://perfht.ml/2gQnolr
> 
> That seems pretty bad to me.  I mean, this site is not doing much actual
> work.  Is there a graphics issue here?

I agree, that seems pretty terrible. IIRC, the paint time is mostly in gfxUtils::DrawPixelSnapped() which is probably doing scaling. Jeff, any insight into the profile here?
Flags: needinfo?(jmuizelaar)
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195

Needinfo :susheel if you think this bug should be re-triaged.
Priority: -- → P5
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: