Skip to content
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

Extremely high CPU usage causing phone to overheat #64

Open
paplorinc opened this issue Feb 3, 2023 · 13 comments
Open

Extremely high CPU usage causing phone to overheat #64

paplorinc opened this issue Feb 3, 2023 · 13 comments

Comments

@paplorinc
Copy link

It seems that shimmering causes a ~40-60% CPU usage when running:

It's so severe that my phone overheats.

If I give it a stopping condition (i.e. loop: 2), it's reduced considerably:

@dmitry-grin
Copy link

"Use one [Shimmer] to wrap a list of [Widget]s instead of a list of many [Shimmer]s"

Make sure you are not having little shimmers animating themselves instead you need to have parent shimmer, applying animation over multiple containers/placeholders

@paplorinc
Copy link
Author

Even a single one was causing it - is there a busy wait underneath? A simple animation like this shouldn't cause the overheating. If there is, maybe even a tiny sleep (or a https://api.flutter.dev/flutter/scheduler/Ticker-class.html, maybe, not sure) could solve the warming...

@reza00farjam
Copy link

Hi everyone! Any updates?

@soheb12
Copy link

soheb12 commented Jun 11, 2023

Interesting, I found similar spike in CPU usage. Were you able to figure out the root cause? I've incorporated @dmitry-grin's feedback but is there anything else we can do to reduce the CPU usage?

@istornz
Copy link

istornz commented Jul 28, 2023

Same here ...

@joaopmarquesini
Copy link

joaopmarquesini commented Aug 26, 2023

Do any of you experience this overheating on Android?
I'm facing the same issue but seems to be happening only on iOS. Also trying to figure out is this could be an Impeller issue.

@giantss
Copy link

giantss commented Sep 13, 2023

Same here ...

@splimter
Copy link

Same here with shimmer: ^3.0.0

@bahiraei
Copy link

this is very bad!

@b099l3
Copy link

b099l3 commented Mar 12, 2024

Came across this issue after our users have reported our app is draining battery life and phone getting hot, only on iOS? Similar to @joaopmarquesini

Is there away round this or it is due to using multiple shimmers on the one view?

@joaopmarquesini
Copy link

@b099l3 from what I tried, even if I used a single shimmer but had it constantly on screen (I was using it on animations for a gaming app) the phone would overheat.

@b099l3
Copy link

b099l3 commented Mar 13, 2024

Slightly unrelated but also good to know for others. We also use Intercom in our app and this issue also mentioned high CPU load.
I updated Intercom to 16.5.4 it out and it massively dropped our CPU usage 120-130% to 30-40% 🤯

BEFORE

imp-eng imp-cpu

AFTER

Screenshot 2024-03-13 at 11 06 13 Screenshot 2024-03-13 at 11 06 05

@istornz
Copy link

istornz commented Mar 13, 2024

On my side, I have set the loop to 1 as a temporary workaround. Now the shimmer only play 1 time, I don't have any CPU issues now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants