Repository navigation
Stop the macOS device inventory from stalling frame presentation - #10
Closed
thebornster wants to merge 1 commit into
Closed
thebornster wants to merge 1 commit into
thebornster wants to merge 1 commit into
Conversation
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
force-pushed
the
fix-macos-device-inventory-stall
branch
from
October 27, 2026 10:58
dca5ce4 to
ba4f69b
Compare
thebornster
marked this pull request as ready for review
October 30, 2026 07:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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