jschiefner / advanced-brightness-slider-tweak

iOS Tweak that manipulates the brightness slider in the control center so the display brightness and the white point intensity can be modified
https://havoc.app/package/advancedbright
GNU General Public License v3.0
29 stars 6 forks source link

High CPU when adjusting brightness #2

Closed rastafaa closed 2 years ago

rastafaa commented 3 years ago

When I adjust the brightness while tweak enabled, the CPU usage explodes very high. I especially notice while in another app. The slider movement is a bit jerky and my batt rate display indicates massive battery drain as I move the brightness slider up and down. I tested repeatedly with this tweak enabled and disabled and concluded the issue must be caused by this tweak.

jschiefner commented 3 years ago

Hey, thanks for bringing this to my attention. I used XCode Instruments to check the CPU usage with and without the tweak. I found that it does not really differ a lot with and without. The processes SpringBoard and backboardd went up significantly with and without the tweak, maybe a little more with the tweak enabled but i couldn't say for sure. I think the battery drain would not be a great issue since we're not moving the slider all day long but only on occasion. The jerky movement is a problem though of course. May I ask what iOS Version you're on and what Device you're using? Also, how did you monitor the CPU usage and battery drain?

I pushed an update to packix today (version 0.1.2), maybe that solves your issue. I added some code to avoid making system calls which probably put a big load on backboardd, but i did not see a big change in CPU power so i'm not sure if that helped.

rastafaa commented 3 years ago

Thanks I'll check it out. I was using cocoatop and battrate tweak to show current drain rate. I didn't notice issues the first couple days I was using your tweak (it seemed smooth) but then for some reason yesterday it was being really bad while I was in an app adjusting brightness, the slider wasn't smooth and the phone was getting hot etc every tune I adjusted it so I realized something was wrong. That's when I tried repeatedly enabling and disabling the tweak and saw that it consistently was much better when disabled.

I'll try the new version though.

rastafaa commented 3 years ago

I’m not seeing the new version available yet.. it shows in the change log but the updated file isn’t appearing in the repo

edit: nevermind it just showed up now

rastafaa commented 3 years ago

Still seeing the issue on the new version unfortunately

I forgot to say my device details: iOS14.4.1 iPhone X

jschiefner commented 3 years ago

Hey, i finally got around to testing it out with the tools you mentioned (cocoatop and battrate). I can see the battery drain on my phone, and again the heavy load on backboardd, which is however also occuring without the tweak installed. The iPhone X should however be fast enough to handle everything. Sorry that i cannot help you out further with this... I'll push an update tomorrow which will address other things though. Maybe try that one last time, the code should be a little cleaner than before. Thats a long shot though, i am really not sure whats causing your slider to be jerky like that