Skip to content

Windows: read the display's GPU vendor while the event loop is made - #757

Merged
Hona merged 1 commit into
devfrom
ib-3-vendor
Nov 12, 2026
Merged

Hona merged 1 commit into
devfrom
ib-3-vendor

Conversation

@Hona

@Hona Hona commented Nov 12, 2026

Copy link
Copy Markdown
Member

The CPU side of the first window enumerated the display devices (EnumDisplayDevicesW, for HalfRounding) on its path: 1,507 µs p50 between x.painter and cpu.side (tabs10, release, visible desktop, n=8, temporary marks on ib-3-createmarks).

Now find_display_vendor_soon starts that read on its own thread just before EventLoop::new (about 5,000 µs on Windows), and display_vendor keeps the answer in a OnceLock; a window that asks sooner waits for the thread. pick still enumerates the displays fresh for the GPU.

cargo check -p rune --all-targets: no new warnings. No tests touched.

EnumDisplayDevicesW took 1,507 us (p50, n=8) on the first window's path, inside the CPU side
(window.framed -> cpu.side). It now runs on its own thread from before EventLoop::new, once per
launch; the first window waits only if it asks sooner.
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:24
@Hona
Hona merged commit 3cbc9eb into dev Nov 12, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Hona added a commit that referenced this pull request Nov 12, 2026
…774)

Started before EventLoop::new (#757), EnumDisplayDevicesW on its thread contended with winit's
first CreateWindowExW and made windows.launch -> loop.built 1,134 us slower (5,428 against 4,294,
p50, n=10). Started just after loop.built, it runs while the app sets up: +131 us there, and the
first window's path (loop + creation) is 10,949 us against 13,247 before #757-#760.
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.

2 participants