Skip to content

Instantly share code, notes, and snippets.

@albinjosep
Forked from aforren1/gsoc2022.md
Created September 29, 2022 04:11
Show Gist options
  • Save albinjosep/03d8515f190fec0fb37c87e52e9b7993 to your computer and use it in GitHub Desktop.
Save albinjosep/03d8515f190fec0fb37c87e52e9b7993 to your computer and use it in GitHub Desktop.
Reducing Chrome’s Presentation Latency on Windows

Reducing Chrome’s Presentation Latency on Windows

Alex Forrence
email: alex.forrence@gmail.com

Intro

For this project, I improved presentation latency in Chrome on Windows by introducing waitable swap chains. Waitable swap chains allow us to both reduce latency by shortening the queue of pending frames and aligning frame production for optimal consumption by the operating system, and reduce latency spikes by dropping frames under load.

Initial proposal:

https://docs.google.com/document/d/186jZ_FqFgvgq6l3dRNHbzoREP2RdN2hicb143m45xko/edit?usp=sharing

Latency Measurement Device

In order to directly measure the presentation latency, I developed a microcontroller-based platform. The platform uses the WebHID API to communicate the onset of drawing within requestAnimationFrame callbacks to the microcontroller, which records the physical state of the screen with a phototransistor.

https://github.com/aforren1/chrome-lag-test (code)
https://aforren1.github.io/chrome-lag-test/index.md.html (documentation)

CLs (changelists)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment