-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scroll performance significantly degraded on iPhone X, Xs devices due to irregular input events delivery. #31086
Comments
I tried the tiny sample app on my iPhone X and iPhone 5. I can verify that only on the iPhone X there are frequent stutters (lost frames) while drag-scrolling. As soon as I let go of the screen with finger and it only scrolls on inertia, it is fine. There is also an increase of these stutters if I swipe up to app switch on iPhone X and then just taps the app again to resume it, and right when it has been resumed again I start drag scrolling. This might be related to this issue: #28113 |
Wild guess but we seem to have seen a similar issue in #6135 only during touch events. We may need to gate the incoming event flow. |
Thanks to @yunyu 's example app, I reproduced some stutters on iPhone X but not on iPhone 6S. dart-timeline-2019-3-29.json.zip Considering that it only happened on iPhoneX but not iPhone6S, I think it's related with the GPU hardware and the OpenGL driver of iPhone X. My hope is that Skia's Metal backend will eventually solve this kind of problem. So far, I'm not sure how Flutter can fix this without Skia's help. @bsalomon (Skia's GPU lead): can you see something suspicious from the trace? Does Skia currently run tests on iPhone X? I seem to only find iPhone 6/7 on perf.skia.org . I guess as iPhone X gets more market share, such performance issues will become more and more critical. Also note that this performance issue only happened during first launches or app switches. So any performance tests that did a lot of warm up repetitions may not catch it. |
@liyuqian Just to note, this performance issue is also noticeable if you hold your finger down while scrolling (it doesn't occur when you fling by releasing your finger). Not sure if that is a separate issue. |
@yunyu if you're seeing this on the simulator, that's a different issue that happens when keeping the finger down on non-Flutter simulator apps too, like the Settings app. |
@tvolkert I am seeing this on a physical device with the example app linked previously. |
The effect is severe on iPhone X and minimal, but still observable, on iPad Pro (2. Gen.). Haven’t tested with other devices yet. BTW: Mostly, the jittering is gone after 2-3 sec. But I even experienced times, where the jittering stays and can only be stopped with a restart of the app. |
Sorry for slow response, just got back from vacation. I took a look at the trace. There is a crazy amount of time being spent in GrRenderTargetOpList::onExecute (31ms in one frame) but there isn't enough tracing detail to know what is actually happening in there. We'd need more detailed tracing events to get a better idea of where the time is going. Side note: it's probably not too early to start trying to integrate the Metal backend. We're at the point where it draws almost everything correctly and performance is approx equal to GL with low hanging fruit still left to pick. |
@bsalomon what would be the best way to get more detailed tracing? |
@bsalomon Any update on this matter perhaps from your side? |
I'd try removing this check for android framework so that we can see which ops are taking a long time: |
I see the same on my iPhone X. However, interestingly when I turn on screen recording, the jitter completely disappears and everything is super smooth. I verified that multiple times. |
@tvolkert I am using platform views. Will the metal backend work with them? |
Btw another interesting observation: I don’t see jitter when in landscape mode. |
@derolf I still experience jitter in landscape mode |
@derolf it should. If you're willing to give it an early try, we'd love the feedback on what works for you and what doesn't! |
@tvolkert I’ll prolly give it a shot tomorrow. Does someone else see the jitter going away when doing screen recording? |
@derolf I tested the screen recording theory and still see jitter in my app. |
I can confirm this app having the jank-disease on my iPhone Xs and that’s also the exact behavior I have on the app I am developing. |
@liyuqian sorry, it was an Xs. I edited my comment above. |
I still have some questions:
|
@derolf :
Unfortunately, the previous patch has been reverted. But I'm relanding it with some additional fixes: flutter/engine#12280
The kinetic scrolling shouldn't be affected by input events so there shouldn't be any jank even without the fix. Can you please attach more details of the jank, especially on how to reproduce it?
I'm not sure how it could disappear. It seems to me that the jank will disappear in all cases after the patch. (Reopen the issue due to the revert.) |
Seems to be fixed on master now |
@liyuqian should this bug be re-closed? |
Yes, the relaneded fix in the framework since b9a34de . Closing this issue. |
Reopen for another revert... |
I'm observing the same irregular input delivery and dropped events on Android OnePlus 7 Pro. Alleviated greatly with cherry picking #36616 , tho @derolf reports above that the jitters are gone, when screen recording. I observe the same, while the screen recorder is locked at 60fps. |
The fix has been relanded in 4891e4a . Hopefully it won't be reverted this time. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Myself and some others discussing in #22314 have noticed significant scroll performance issues on iPhone X,Xs devices with scrolling views.
Anecdotally it seems drag gestures are the main issue, while flings seem slightly better.
@coreysprague suggested it may be because these devices have a 120hz gesture sample rate (https://www.macworld.com/article/3235709/iphone-x-samples-touch-input-at-120hz-for-faster-smoother-response.html).
Just want to clarify that this does happen even when running in release mode.
Steps to Reproduce
Here's a tiny sample app where you can reproduce the scroll jitters and frame skips, just grab an iPhone X,Xs and run in release mode.
Logs
No errors in logs w/
flutter run --verbose
No issued found w/
flutter analyze
The text was updated successfully, but these errors were encountered: