Comment by iknowstuff
3 hours ago
There's a bug causing NSStatusItems in MenuBar<->WindowServer to enter a continuous redraw loop after a number of hours of uptime which pins CPU at like at least 10-20%. I filed it as FB24528844
1. WindowServer sends the app a stream of remote-context notifications (CGSDatagramReadStream::dispatchMainQueueDatagrams -> remote_context_notify).
2. AppKit responds by rebuilding the status-bar window's tracking areas and structural regions (_NSTrackingAreaAKManager _updateStructuralRegionCreateIfNeeded / displayCycleUpdateStructuralRegions, including NSButtonCell _hasRolloverAppearance for the menu bar rollover effect).
3. That dirties the window, so UpdateCycle/stepTransactionFlush commits a CA::Transaction to the WindowServer.
4. Another notification arrives and the loop repeats at display refresh rate.
Just so you know, a process pinning the CPU at 10-20% on Apple Silicon doesn't even cause any perceptible impact to multitasking. I've pinned the CPU far higher and not noticed anything like this, so it's definitely not that issue. I sometimes forget workloads are even running because the rest of the system feels so perfectly fine even when the fans are running full tilt.
This causes big pauses and stutters system-wide, which is not consistent with any level of CPU utilization alone.