Lottie Animation inside CollectionView Cell CPU consumption #2014
Replies: 3 comments 1 reply
-
Can you share a copy of the animation you're using? |
Beta Was this translation helpful? Give feedback.
-
One of these animations (dance.json) is not supported by the Core Animation rendering engine since it uses time remapping. When animating this with the main thread rendering engine, I see the CPU usage hovering around 20%+. This probably explains why you're seeing a high baseline CPU utilization.
The issue here sounds like the The Core Animation rendering engine does have a higher setup cost than the Main Thread rendering engine, so you may find that the performance is better for your use case if you usr the Main Thread rendering engine instead. |
Beta Was this translation helpful? Give feedback.
-
Hello! I got stuck into a problem with high cpu consumption of my collection view. It has several cells and built with compositional layout. The last section contains the cell with lottie animation. For now, I aggregated only 5 items and cpu level grows over 30 % in static and grows over 50-70 % when scrolling the collection. Just imagine how far it will grow if I add more and more items. I've tried multiple workarounds such as separating json parsing and animation play back on different threads but it didn't do me any good. Also found a sample project on YouTube and there the collection works perfectly fine no matter how many items the collection contains but it only has one type of cell. I'm using Lottie 4.1.3 version.
Beta Was this translation helpful? Give feedback.
All reactions