CPU Usage when having more GifImageView's
Madeleaan opened this issue · 3 comments
I have an app that overlays multiple images onto each other with FrameLayout. This also includes 6 GifImageView
s. However, when i go to that activity, the cpu usage in the profile spikes to 60% and stays around that level afterwards. This only happens on my old tablet (Samsung Galaxy Tab 4), which is the only device that will be running this app. On my phone (Xiaomi Redmi Note 9 Pro), it has no problem.
Having all the gifs paused on the view creation will still result in a noticeable lag. Is there a way to optimize it, or is it just the old CPU struggling to render so many moving things at once?
Could you create and share a reproducer project?
The project is available at https://github.com/Madeleaan/Noustea. The gifs are currently paused programatically in src/main/java/madeleaan/noustea/ui/viewport/ViewportFragment.kt
Sorry for the delay.
I don't see any field of improvement inside the library.
The only idea I have is to use opaque GIFs where possible. If there is always the same color in the background, you can embed it into the GIFs. Alpha channel can be omitted then and there will be less bytes to process.