Skip to content

[performance] a small iOS app built by Flutter has too much battery impact #26895

@PerrchicK

Description

@PerrchicK

Description

Every time I use an app built by Flutter the Xcode indicates a very high energy impact.

I first noticed this reaction when playing a flare animation. But later I noticed it appears in every render of the UI. Am I using it wrong? Does everybody see this in their projects?

The GPU average usage meter may seem legit, since it’s an average there’s a good explanation for that. But why does it affect the battery so much? I want to build an app for production usage but doesn't seem quite healthy.

Uploaded this demo clip:
https://www.youtube.com/watch?v=I_VacxqDKDg
Downloadable code (Flutter, iOS & Android projects), in case you'll find some mistake there:
https://www.dropbox.com/s/dt32jpuihcg7gm4/battery_impact_example.zip?dl=0

Thanks a lot!

Preconditions

  • The app should have a scrollable scroll view (even an empty one would reproduce this issue).
  • You can have a lite endless animation instead.
  • Build the app using Flutter.
  • Use a real device (in my case I used iPhone Xs).

Steps to Reproduce

  1. Run the iOS app from your Xcode.
  2. Go to "Debug Navigator" pane.
  3. Scroll the UI back and forth / observe the endless animation.
  4. While scrolling / animation is playing, observe the battery impact and the GPU usage.

Expected result

A production app shouldn't impact the battery so much.

Actual result

According to Xcode's profiler, the app consumes too much battery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine repository. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions