3 ms·
On ChromeOS and Windows, you can use a desynchronized 2D or WebGL canvas to avoid the additional latency at the cost of tearing artifacts and no ability to sync
by wffurr 5y ago
On ChromeOS and Windows, you can use a desynchronized 2D or WebGL canvas to avoid the additional latency at the cost of tearing artifacts and no ability to synchronize updates with the surrounding DOM.
https://developers.google.com/web/updates/2019/05/desynchronized https://developers.google.com/web/updates/2019/05/desynchron...
We added this for low latency drawing in Keep and Chrome Canvas and the ChromeOS PDF annotation mode.
- frankenst1 5y agoDo you have any experience if this actually improves things on Windows (not ChromeOS)? AFAIK DWM is the main culprit here (1-2 frames) and `desynchronized` does not circumvent it (but avoids at best 1 frame of canvas vs DOM synchronization).
- wffurr 5y agoOn Windows it's a modest improvement, as you saw. We would need to bypass DWM to do better, e.g. with a hardware overlay.
- jd3 5y agoIt's been a long time since I used Chrome on Windows — do you know if Chrome's fullscreen mode leverages exclusive fullscreen/fse/fullscreen optimizations[0]? I'm pretty sure that's what most games use to bypass the forced DWM vsync. For example, when I used Dolphin on one of those cheap 60hz IPS LCD monitors with no internal scaler, I always preferred the lower latency + tearing in exclusive fullscreen compared to the laggy + smooth windowed mode. There was honestly such a stark difference between the two that I found the game to be unplayable in DWM's windowed vsync mode. [0]: https://devblogs.microsoft.com/directx/demystifying-full-screen-optimizations/ https://devblogs.microsoft.com/directx/demystifying-full-scr... edit: to answer my own question, it looks like Chrome does not use exclusive fullscreen https://news.ycombinator.com/item?id=28784108 https://news.ycombinator.com/item?id=28784108
- kfarr 5y agoThis sent me down a rabbit hole to see if desynchronized canvas might improve rendering three.js scenes. TLDR: No https://github.com/mrdoob/three.js/issues/16684 https://github.com/mrdoob/three.js/issues/16684
- wffurr 5y agoTBF even the spec authors are a bit confused about that attribute: https://github.com/whatwg/html/issues/5466 https://github.com/whatwg/html/issues/5466 It has complex and non-obvious effects. greggman on the three.js issue wrote a really nice summary on why it shouldn't be the default. It's really only appropriate for highly latency sensitive applications, like drawing or certain games.