Post

Replies

Boosts

Views

Created

CPU power is poor when scrolling slow (CPU power / battery efficiency question)
I built a custom ScrollView (VirtualisedList) based on ScrollView and observed a weird thing. As in any other virtualised list I'm adding views whenever the viewport is not fully covered and removing items them when they already are outside of the viewport. I'm losing some frames when scrolling slow. It's completely counterintuitive but that's what's happening. I first thought that probably something is wrong with my code but it turned out that inflating items when scrolling slow is using the same amount of cpu cycles as when scrolling fast. The Cpu just seems to be slower. Let me give you a bit more details. I have an example app without any business logic so when it comes to the app process the only work that is being done is inflating items on UI thread. When no-one is scrolling of if there is no ongoing animation nothing is happening on the thread. I have an assumption that iOS battery saving mechanisms are slowing down CPU if there is not much happening. I added an artificial thread that is doing some made up things in background and the problem with slow CPU was gone. Are you able to help me understand what could be happening here and if there is any way to tell iOS system that we need full power as certain moment?
2
0
1.2k
Jan ’23