https://tonsky.me/blog/disenchantment/
Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
31–40 of 145 posts
Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#32Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#33This is such a classic UI programming bug, and almost every UI programming framework has a way to achieve this accidentally using core components. React is notorious for this, but even in non-declarative frameworks it's very easy to get a reactivity loop on a trigger or model update and do this.
It’s way easier in declarative frameworks, though.
Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#34Earlier quoted context omitted.
It’s way easier in declarative frameworks, though.
Yes, but only because you aren’t re-rendering when data changes (which is half of the entire point of an UI) implicitly. Having worked on enough imperative UI kludge, I think that declarative probably saves enough dev-hours (and associated calories, Typescript, Swift, Rust, etc. compile time) to outweigh the infinite loop bugs.
Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#35Off topic: I wish someone would do this kind of analysis to determine why Microsoft Teams helper process is always at 50-70% CPU load on my M-Based MacBook Pro. My laptop is warm/hot to touch as a result of it.
Because Teams, and also because Electron.
Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#361% CPU load? Windows 11's Task Manager sips 6-8% of my 9750H
Control Centre is an always-on process. It sits on the menubar, and provides access to settings like sound, bluetooth, wireless, etc.
Edit to add: On that first screenshot, you can see that Activity Monitor is using 3.4% CPU. In my experience, it fluctuates between 3% and 10% most of the time.
Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#37Off topic: I wish someone would do this kind of analysis to determine why Microsoft Teams helper process is always at 50-70% CPU load on my M-Based MacBook Pro. My laptop is warm/hot to touch as a result of it.
I’m not experiencing that issue. Have you tried completely uninstalling it and reinstalling?
But after receiving the push update converting Team to using the Electron version of the app, CPU load dramatically increased.
Wish I could convert back to the older Apple Silicon non-Electron version.
Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#38Earlier quoted context omitted.
Yes, but only because you aren’t re-rendering when data changes (which is half of the entire point of an UI) implicitly. Having worked on enough imperative UI kludge, I think that declarative probably saves enough dev-hours (and associated calories, Typescript, Swift, Rust, etc. compile time) to outweigh the infinite loop bugs.
I meant it’s way easier [to enter an infinite render loop] in declarative frameworks.
I don't think it's much harder to infinitely update properties that cause a redraw in a non-declarative framework, but doing so probably has less impact because it often won't redraw the entire screen, and may do less work overall because of how the framework is structured.
Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#39That's probably a good amount of battery life that can be claimed back once this is fixed
Re: Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
#40I see 0% CPU for control center here (13.6) so either fixed, or not always the case.
It must not always be the case. I'm sure they have a power team at Apple who ensure a Mac can sit on the desktop without any CPU wake-ups.