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

CPU usage is verrrrrry high #130

Open
1 task
BabakScript opened this issue Feb 18, 2023 · 13 comments
Open
1 task

CPU usage is verrrrrry high #130

BabakScript opened this issue Feb 18, 2023 · 13 comments
Labels

Comments

@BabakScript
Copy link

BabakScript commented Feb 18, 2023

Overview

I have 4 Lottie animations on my page. I downloaded them from lottiefiles.com but after adding these animations the CPU usage of the page and my system increased a lot. It's always between 80% to 100% and the laptop fan is working constantly but after closing the page everything is OK. Is it normal with Lottie animations? This is just a small personal website with 4 small Lottie animations. Also, the size of my animation files is between 70 KB to 350 KB.
I also tried to set subframe to false to save some CPU but that's not improve anything:

<Player
                lottieRef={instance => {
                  instance.setSubframe(false)
                }}
                autoplay
                loop
                src={item.animationUrl}
                className="h-[250px] w-[250px]"
              />

Any suggestions for improving the page and CPU performance?

Consuming repo

What repo were you working in when this issue occurred?

...

Labels

  • Add the Type: Bug label to this issue.
@BabakScript BabakScript changed the title Verrrrrry high CPU usage CPU usage is verrrrrry high Feb 18, 2023
@humirang-j
Copy link

I also encounter this issue, not only the CPU usage also the memory is too big.
when I disabled all my Lottie animations my web app has about 200mb memory but when I enabled it reaches 400mb - 500mb on initial load then will reach 1GB+ after a few seconds.

I have a dynamic number of Lottie animations.

@Exkalybur
Copy link

We are running into similar issue, where CPU and GPU usage is going beyond acceptable, even when using only 2 lottie files and not much of other stuff going on the page.

Without lottie, CPU is at around 10% and GPU around 20%, while running about 30 chrome tabs, slack, vs-code, terminals and the web app itself.
With lottie, CPU usage jumps to about 60-70% and GPU goes to 80%.

Something seems off with the way the resources are consumed, 2 small files shouldn't increase usage of resources as much as it currently does.

Would be great to hear something from maintainers, since this issue soon to be 2 months old and 0 replies.

@samuelOsborne
Copy link
Member

Hi @BabakScript It could be good to go per animation and see which one is causing large CPU usage, 350kb is on the large size for Lotties.

You can also create an issue on the lottie-web repo and upload your files to get help with your animations and see why they're causing large CPU usage: https://github.com/airbnb/lottie-web

@deshario9
Copy link

I'm also experiencing the same issue

The memory is not being freed up/remains occupied even after the animation is closed/destroyed.

Playing multiple animations sequentially will eventually result in a browser crash.

I've multiple animations, each with a size of 2.5 megabytes.

Screen Shot 2566-05-05 at 23 33 46

@saul-data
Copy link

saul-data commented May 16, 2023

I am experiencing the same high CPU usage - I tried the suggestion here: airbnb/lottie-web#2427 (comment)

@samuelOsborne
Copy link
Member

@deshario9 Does your animation use a repeater? This is from the docs

animationData: an Object with the exported animation data. Note: If your animation contains repeaters and you plan to call loadAnimation multiple times with the same animation, please deep clone the object before passing it (see airbnb/lottie-web#1159 and airbnb/lottie-web#2151.)

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Jul 16, 2023
@mnlbox
Copy link

mnlbox commented Sep 27, 2023

Any plan to fix this issue?

@github-actions github-actions bot removed the stale label Sep 28, 2023
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Nov 27, 2023
@aleczratiu
Copy link

Any updates here?

@github-actions github-actions bot removed the stale label Mar 11, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label May 10, 2024
@zamitto
Copy link

zamitto commented Oct 24, 2024

Any updates?

@github-actions github-actions bot removed the stale label Oct 25, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants