You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
meta: Polling and busy-spin audit (CPU burn, UI stalls) #1273
Audit of every place that polls or waits by polling (CPU/RAM/GPU/disk/stats metrics, retry loops, worker threads, UI timers), looking for loops that can busy-spin, collapse to a ~0 interval, or stall the UI. Done against origin/master 8e729be3d.
Summary: nothing polls in a tight loop with no sleep at all. The main hazard is on Windows: os_sleep_ms(1) becomes Sleep(0) (a yield), so "sleep 1 ms" retry loops become yield-spins at ~100% of a core. The other findings are intentional per-frame spinning, UI-thread work, and one rare error-path spin.
Each finding is a sub-issue. Ranking:
A: can busy-spin or reach a ~0 interval
B: expensive or on the UI thread
gap: not yet audited
Each sub-issue's fix should come with a test that bounds the work: iterations per second, time on the UI thread, or wake-ups while idle, so a regression shows up as a number.
Already tracked elsewhere: the Windows PDH GPU sampler, which reopens the query every second. Its cost and a slow-card backoff are covered on #1022 (follow-up comment there), with the persistent-query change owned by @vpacher.
Fine as is:
CPU label: 3 s, times() / task_info.
Stats window: RAM via statm every 2 s, only while visible.
Status bar: 1 s while active.
Hotkey thread: 25 ms timedwait.
Audio thread: os_sleepto_ns_fast sleeps at least 1 ms.
Media playback: waits capped at 200 ms, semaphore while paused.
Follow-up left over from #1284 (PR #1326): when the ingest list's HTTP request itself fails, file-updater never calls the update callback, so the refresh-done event is never signalled and the caller still waits the full timeout (3 s from rtmp_common_url, 5 s on the UI thread in the auto-config wizard). Fixing it needs shared/file-updater to report failure to the callback, or signal completion either way.
obs-websocket part of #1285 audited: #1344 (Stop() UI-thread deadlock), #1345 (GetStats disk query stalls the pool on a hung path, relates to #1282), #1346 (GetStats CPU usage data race).
Activity
zackees commentedon Oct 17, 2026
Follow-up left over from #1284 (PR #1326): when the ingest list's HTTP request itself fails,
file-updaternever calls the update callback, so the refresh-done event is never signalled and the caller still waits the full timeout (3 s fromrtmp_common_url, 5 s on the UI thread in the auto-config wizard). Fixing it needsshared/file-updaterto report failure to the callback, or signal completion either way.vpacher commentedon Oct 17, 2026
obs-websocket part of #1285 audited: #1344 (Stop() UI-thread deadlock), #1345 (GetStats disk query stalls the pool on a hung path, relates to #1282), #1346 (GetStats CPU usage data race).