Skip to content

Stop the macOS device inventory from stalling frame presentation - #10

Closed
thebornster wants to merge 1 commit into
OZORDI:mainfrom
thebornster:fix-macos-device-inventory-stall
Closed

thebornster wants to merge 1 commit into
OZORDI:mainfrom
thebornster:fix-macos-device-inventory-stall

Conversation

@thebornster

@thebornster thebornster commented Oct 27, 2026 •

Copy link
Copy Markdown

The Cocoa device inventory runs once a second on the UI thread, which also presents frames, and it copied every property of every HID device. On an M1 MacBook Pro that took about 370 ms, 260 ms of it for a single built-in device. The display froze once a second and the render thread's frame handoff hit its 250 ms timeout. This reads only the five properties the inventory checks. That takes under 1 ms and finds the same devices.

On the Metal renderer, timed-out handoffs went from one per second to none.

thebornster

The Cocoa inventory refresh copied every property of every HID device once a second on the UI thread, which also presents frames. On an M1 MacBook Pro one built-in device takes about 260 ms to copy, so the whole refresh took about 370 ms. Each refresh froze the display and timed out the render thread's handoff. Read only the five properties the inventory uses, which takes under 1 ms.

Signed-off-by: thebornster
@thebornster
thebornster force-pushed the fix-macos-device-inventory-stall branch from dca5ce4 to ba4f69b Compare October 27, 2026 10:58
@thebornster
thebornster marked this pull request as ready for review October 30, 2026 07:29
@thebornster thebornster closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant