You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jittery performance on first run of animation/transitions due to shader compilations #813
On some apps, the first time you run a "big" animation (like a hero transition), there appears to be some jitter/jank. After the animation is warmed up, it appears to become smoother.
This is a tracking issue to investigate and solve.
changed the title [-]Jittery performance on animation first-runs on Android[/-][+]Jittery performance on first run of animation/transitions[/+]on Oct 11, 2017
Reopening as this is a systemic issue. Report from our mailing list: "2) First time loading shows lag, but after some time experience becomes smoother." and "Initially home screen lags for the first time only, then it gets smoother" and we recently saw it with a customer's app and their initial onboarding screens (on a Pixel, a modern phone).
Reacted by Johnson Yeap, Sasha Isaienko, Sven Schöne, luckysmg and VadimOsovsky
We're coming up with a long-term solution for this and that progress is tracked publicly on #32170 . Currently, we have a 16-page internal draft design doc with 9 different proposed solutions in it.
In shorter terms, we believe that there might be some specific issues that we can quickly solve just for iPhone X since the issue seems to be less bad on older iPhones. We're currently purchasing iPhone X to add to our device lab so we can debug the performance of iPhone X: #34590
@michinchin : we're aware of that hence #32170 is not just for iOS, but also for Android, Fuchsia, Desktop, and probably all platforms that Flutter directly compiles into binaries.
iOS currently just has additional issues. For example, we can store binary persistent shader cache on Android, but we can only store GLSL persistent shader cache on iOS. That requires iOS to do one more compilation (compared to Android). For that, we're also enabling Metal backend for iOS which should help this specific issue.
@liyuqian thank you for the updates. Currently (and because I’m an iPhone X user) I immediately noticed it and I must say that despite of being an issue already tracked, it bothers me somehow to have a production app that launches on a scroll screen where it always feel janky as the user starts it on iPhone for the first 2 seconds.
Oddly and in my experience, it seems to affect only the iOS. Android devices were I’ve tested it, seem to be good and smooth right from the launch point.
@miguelcmedeiros : that's exactly the difference between binary persistent shader cache and GLSL persistent shader cache. On Android, there's 0 work if you close the app and re-open the app. On iOS, re-opening the app triggers another GLSL to binary compilation.
@erf : it's nice to hear that! We're always working hard to improve the performance. While #32170 isn't fixed yet, we've made at least 13 other quantified improvements between Sep 2019 and Dec 2019.
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 flutter doctor -v and a minimal reproduction of the issue.
Activity
eseidelGoogle commentedon May 13, 2016
Now that --release builds exist and use AOT mode, there should no longer be initial compile jitter? If you have specific traces happy to look at them!
[-]Jittery performance on animation first-runs on Android[/-][+]Jittery performance on first run of animation/transitions[/+]sethladd commentedon Oct 11, 2017
Reopening as this is a systemic issue. Report from our mailing list: "2) First time loading shows lag, but after some time experience becomes smoother." and "Initially home screen lags for the first time only, then it gets smoother" and we recently saw it with a customer's app and their initial onboarding screens (on a Pixel, a modern phone).
Hixie commentedon Dec 20, 2017
This is a metabug for tracking these similar issues.
Fixing this is our top performance priority.
Assigning to @cbracken who is currently tasked with investigating this.
86 remaining items
michinchin commentedon Jun 20, 2019
Found it lags for the first time on both Android and iOS initial start up
liyuqian commentedon Jun 20, 2019
We're coming up with a long-term solution for this and that progress is tracked publicly on #32170 . Currently, we have a 16-page internal draft design doc with 9 different proposed solutions in it.
In shorter terms, we believe that there might be some specific issues that we can quickly solve just for iPhone X since the issue seems to be less bad on older iPhones. We're currently purchasing iPhone X to add to our device lab so we can debug the performance of iPhone X: #34590
michinchin commentedon Jun 20, 2019
This is not only an issue on the iPhone X. We have done testing on the Pixel 3 and other android devices and have found the same effect.
liyuqian commentedon Jun 20, 2019
@michinchin : we're aware of that hence #32170 is not just for iOS, but also for Android, Fuchsia, Desktop, and probably all platforms that Flutter directly compiles into binaries.
iOS currently just has additional issues. For example, we can store binary persistent shader cache on Android, but we can only store GLSL persistent shader cache on iOS. That requires iOS to do one more compilation (compared to Android). For that, we're also enabling Metal backend for iOS which should help this specific issue.
miguelpruivo commentedon Jun 20, 2019
@liyuqian thank you for the updates. Currently (and because I’m an iPhone X user) I immediately noticed it and I must say that despite of being an issue already tracked, it bothers me somehow to have a production app that launches on a scroll screen where it always feel janky as the user starts it on iPhone for the first 2 seconds.
Oddly and in my experience, it seems to affect only the iOS. Android devices were I’ve tested it, seem to be good and smooth right from the launch point.
liyuqian commentedon Jun 20, 2019
@miguelcmedeiros : that's exactly the difference between binary persistent shader cache and GLSL persistent shader cache. On Android, there's 0 work if you close the app and re-open the app. On iOS, re-opening the app triggers another GLSL to binary compilation.
miguelpruivo commentedon Jun 21, 2019
@liyuqian got it. Do you have an idea of when a fix may be available? Have you already found a solution for it or still drafting for?
PS: You've tagged the wrong person. 😄
liyuqian commentedon Jun 21, 2019
Oops. We haven't picked which solution to pursue. Will update #32170 with some proper time estimation once we made the decision.
erf commentedon Mar 8, 2020
@liyuqian Any news on this?
I'm experiencing jaggy animations every first time i do:
Second time i open a page, it' much smoother.
I'm on an iPhone 7.
liyuqian commentedon Mar 10, 2020
@erf : we're actively working on SkSL shader warm-up. Some preliminary results on iOS should be available in 1-2 months.
liyuqian commentedon Mar 26, 2020
For progress, please check #32170 . We'll be referencing it when we're making smaller fixes.
erf commentedon Mar 30, 2020
@liyuqian i feel the performance has been improved in the latest dev version 1.16.3 ..?
liyuqian commentedon Mar 30, 2020
@erf : it's nice to hear that! We're always working hard to improve the performance. While #32170 isn't fixed yet, we've made at least 13 other quantified improvements between Sep 2019 and Dec 2019.
lock commentedon Apr 15, 2020
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
flutter doctor -vand a minimal reproduction of the issue.