Skip to content

Jittery performance on first run of animation/transitions due to shader compilations #813

Closed

Description

@sethladd

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.

Activity

  1. added
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Dec 11, 2015
  2. added this to the milestone on Dec 11, 2015
  3. eseidelGoogle commented on May 13, 2016

    @eseidelGoogle
    Contributor

    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!

  4. modified the milestones: , 3: Current Milestone on Oct 11, 2017
  5. changed the title [-]Jittery performance on animation first-runs on Android[/-] [+]Jittery performance on first run of animation/transitions[/+] on Oct 11, 2017
  6. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    and removed
    platform-androidAndroid applications specifically
    on Oct 11, 2017
  7. sethladd commented on Oct 11, 2017

    @sethladd
    ContributorAuthor

    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).

  8. Hixie commented on Dec 20, 2017

    @Hixie
    Contributor

    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.

  9. 86 remaining items

  10. michinchin commented on Jun 20, 2019

    @michinchin

    Found it lags for the first time on both Android and iOS initial start up

  11. liyuqian commented on Jun 20, 2019

    @liyuqian
    Contributor

    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

  12. michinchin commented on Jun 20, 2019

    @michinchin

    #32170

    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.

  13. liyuqian commented on Jun 20, 2019

    @liyuqian
    Contributor

    @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.

  14. miguelpruivo commented on Jun 20, 2019

    @miguelpruivo

    @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.

  15. liyuqian commented on Jun 20, 2019

    @liyuqian
    Contributor

    @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.

  16. miguelpruivo commented on Jun 21, 2019

    @miguelpruivo

    @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. 😄

  17. liyuqian commented on Jun 21, 2019

    @liyuqian
    Contributor

    Oops. We haven't picked which solution to pursue. Will update #32170 with some proper time estimation once we made the decision.

  18. erf commented on Mar 8, 2020

    @erf

    @liyuqian Any news on this?

    I'm experiencing jaggy animations every first time i do:

    Navigator.push(MaterialPageRoute(fullscreenDialog: true, builder: (context) => SomePage()));
    

    Second time i open a page, it' much smoother.

    I'm on an iPhone 7.

    flutter --version
    Flutter 1.15.18 • channel dev • https://github.com/flutter/flutter.git
    Framework • revision 9437639590 (31 hours ago) • 2020-03-06 10:24:23 -0800
    Engine • revision 5aff311948
    Tools • Dart 2.8.0 (build 2.8.0-dev.12.0 9983424a3c)
    
  19. liyuqian commented on Mar 10, 2020

    @liyuqian
    Contributor

    @erf : we're actively working on SkSL shader warm-up. Some preliminary results on iOS should be available in 1-2 months.

  20. liyuqian commented on Mar 26, 2020

    @liyuqian
    Contributor

    For progress, please check #32170 . We'll be referencing it when we're making smaller fixes.

  21. erf commented on Mar 30, 2020

    @erf

    @liyuqian i feel the performance has been improved in the latest dev version 1.16.3 ..?

  22. liyuqian commented on Mar 30, 2020

    @liyuqian
    Contributor

    @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.

  23. lock commented on Apr 15, 2020

    @lock

    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.

  24. locked and limited conversation to collaborators on Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: performanceRelates to speed or footprint issues (see "perf:" labels)customer: solarisengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions