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

A lot of Lottie animations on website causing high CPU and GPU usage #2427

Open
iterable-marketing opened this issue Jan 11, 2021 · 8 comments

Comments

@iterable-marketing
Copy link

Hello, our website is using a lot of Lottie animations to create an engaging visual experience, but it causes CPU and GPU usage rates to increase significantly. My fans turn and stay on until I exit the site.

Does anyone have guidance or recommendations on how we can alleviate this issue when we use a lot of Lottie animations? Would reducing the amount of movements in the animation file help?

@bodymovin
Copy link
Collaborator

Hi, you could try calling on all animations anim.setSubframe(false), which will render only rounded frames and not subframes.
What can also help is making sure that only the animations that are visible on the screen are running, and pause all the rest.
There is also one of the animations, Activate21_LP_Tickets, which seems to be using a Matte effect. Those effects are very resource intensive, and you might achieve the same by using regular AE masks.

@jmorganslea
Copy link

I am also having this problem on this website www.longbaycollege.com yet the lottie is a pretty small file. Does anyone have any ideas?

@msbt
Copy link

msbt commented Feb 12, 2023

@bodymovin I also have issues with high cpu usage. I'm using the web player, where would I put that call?

@harveyjing
Copy link

I am also having this problem on this website www.longbaycollege.com yet the lottie is a pretty small file. Does anyone have any ideas?

just got into your website, and it is pretty good. But just found that nav bar font color doesn't differ enough from bg color. I just wonder if you have a fixed header and scrollable carousel. that have fixed bg color. just a little recommendation.

@saul-data
Copy link

saul-data commented May 16, 2023

I am experiencing the same - very high CPU usage and I tried to apply anim.setSubframe(false) on all my animations but doesn't improve anything

Here is the link to my animation json:
https://gist.githubusercontent.com/saul-data/6c8550c4f6247068c48137b72e9b0f47/raw/f29546f3b51a807fa5274bb1e1db5df8b848a0ee/animation.json

Using the online player - 20% to 30% CPU usage:
image

@saul-data
Copy link

Even the default examples uses quite a lot of CPU

image image

@laeo
Copy link

laeo commented Dec 4, 2023

Im using lottie-svelte but also reach the same issue, when i play the sample animation provided by lottie-svelte docs, the CPU reaches about 40%, and down to 0 after i clicked stop button.

@danilo-css
Copy link

Im using lottie-svelte but also reach the same issue, when i play the sample animation provided by lottie-svelte docs, the CPU reaches about 40%, and down to 0 after i clicked stop button.

I had the same problem using JSON animation files. Solved it using ".lottie" files instead.

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

8 participants