{"id":40727,"date":"2023-10-04T13:27:25","date_gmt":"2023-10-04T17:27:25","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=40727"},"modified":"2023-10-09T09:13:35","modified_gmt":"2023-10-09T13:13:35","slug":"control-center-in-macos-always-using-cpu","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/10\/04\/control-center-in-macos-always-using-cpu\/","title":{"rendered":"Control Center in macOS Always Using CPU"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/praeclarum\/status\/1706356007348343064\">Frank A. Krueger<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=37654904\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/praeclarum\/status\/1706356007348343064\"><p>The Control Center icon in the Mac [menu bar] is always running and always using 1% CPU. Not a big deal, but I finally had to know wtf it was doing&#8230;<\/p><p>Turns out it is constantly re-rendering its SwiftUI (running layout) even though there is no UI visible. &#x1F923; Yay for modern software<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/praeclarum\/status\/1706725414465683583?s=20\">Frank A. Krueger<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/praeclarum\/status\/1706725414465683583?s=20\"><p>In a nutshell, no, this is not increasing my power usage by 1%.<\/p><p>[&#8230;]<\/p><p>One app doing that isn&rsquo;t a biggie, sure, but it should be fixed anyway. If every background app started doing this, we&rsquo;d end up with lots of wasted CPU cycles. Plus: on weaker machines that process may take up more than 1% and could actually prevent the CPU from fully throttling.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/Harmonicritik\/status\/1706415235597312099\">Harmonicritik<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/Harmonicritik\/status\/1706415235597312099\">\n<p>Functional-reactivity is power-efficient because the view chooses when to ask its components for updated data. SwiftUI was invented for the Apple Watch following this principle.<\/p>\n<\/blockquote>\n\n<p>However, it doesn&rsquo;t work that way in practice, seemingly <a href=\"https:\/\/twitter.com\/staypufd\/status\/1707075177979191304\">because<\/a> AppKit is repeatedly asking SwiftUI for information that it hasn&rsquo;t cached.<\/p>\n\n<p><a href=\"https:\/\/twitter.com\/krzyzanowskim\/status\/1707684940337283563\">Marcin Krzyzanowski<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/krzyzanowskim\/status\/1707684940337283563\"><p>&#x1F914; SwiftUI on macOS underperforming is an understatement. &ldquo;tell me you rewrite user-facing parts of the operating system interface with new technology without checking if that&rsquo;s the right tool for the job&rdquo;<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/dosdude1\/status\/1707759312783675870\">dosdude1<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/dosdude1\/status\/1707759312783675870\">\n<p>Yep, I notice this in EVERY app based on SwiftUI, especially under Mac OS.<\/p>\n<\/blockquote>\n\n<p>Control Center in macOS is just poorly implemented in general. Lots of little glitches, awkward modes and navigation, and it doesn&rsquo;t support keyboard navigation.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/05\/02\/fn-key-reserved-for-system-applications\/\">fn Key Reserved for System Applications<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/11\/15\/mouse-pointer-memory-leak\/\">Mouse Pointer Memory Leak<\/a><\/li>\n<\/ul>\n\n<p id=\"control-center-in-macos-always-using-cpu-update-2023-10-09\">Update (2023-10-09): <a href=\"https:\/\/twitter.com\/SheriefFYI\/status\/1710005747524997538\">SheriefFYI<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/SheriefFYI\/status\/1710005747524997538\">\n<p>This could have significant, subtle power implications - the CPU usage spike might be preventing idle sleep or increasing the system timer tick frequency. Something similar ended up costing me an hour of PC battery life simply by <a href=\"https:\/\/www.reddit.com\/r\/razer\/comments\/5zx6zc\/psa_blade_users_dolby_software_is_costing_you_1hr\/\">preventing down-clocking<\/a>.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Frank A. Krueger (Hacker News): The Control Center icon in the Mac [menu bar] is always running and always using 1% CPU. Not a big deal, but I finally had to know wtf it was doing&#8230;Turns out it is constantly re-rendering its SwiftUI (running layout) even though there is no UI visible. &#x1F923; Yay for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-10-04T17:27:30Z","apple_news_api_id":"3d3b20f0-ffd2-4f56-8bcb-dad3a122644b","apple_news_api_modified_at":"2023-10-09T13:13:38Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/APTsg8P_ST1aLy9rToSJkSw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[1569,30,2385,138,1812],"class_list":["post-40727","post","type-post","status-publish","format-standard","hentry","category-technology","tag-control-center","tag-mac","tag-macos-14-sonoma","tag-optimization","tag-swiftui"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/40727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=40727"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/40727\/revisions"}],"predecessor-version":[{"id":40745,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/40727\/revisions\/40745"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=40727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=40727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=40727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}