Comment by magicalist
6 years ago
> Features like empty divs on top of video? Could be by accident ofc, but the entire story makes this unlikely.
I'd suggest inspecting a few sites you watch video on. An empty div is the least weird thing you'll find.
I highly suspect that the issue is that Windows video playback can only use scanout compositing if there is nothing on top of the video. Scanout compositing is significantly more energy-efficient than standard framebuffer compositing because it avoids a memory copy each frame.
This ultimately comes down to hardware limitations. GPUs are limited as to what they can compose during scanout, because of memory bandwidth limits. Each plane that you can alpha-blend together at scanout time multiplies the amount of memory fetches per dot you have to do. On today's high-DPI displays, the bandwidth going out to the display is very high to begin with, so you can't afford to multiply that by much. That is why putting something on top of a video is tricky: you're adding another layer to be alpha-blended on top, increasing your memory bandwidth by 50% over the two layers you already have (RGB for the background plus YUV for the video). The user's GPU may or may not support that--as I recall, prior to Skylake, Intel GPUs only had two hardware planes, for instance.
I'm not surprised that Microsoft just used "are there any DOM elements over the video?" as a quick heuristic to determine whether scanout compositing can be used. Remember that there is always a tradeoff between heuristics and performance. At the limit you could scan every pixel of each layer to see whether all of them are transparent and cull the layer if so, but that would be very expensive. You need heuristics of some kind to get good performance, and I can't blame Microsoft for using the DOM for that.
> You need heuristics of some kind to get good performance, and I can't blame Microsoft for using the DOM for that.
which, again, that's fine, but mayyyyybe they were a little lax in checking performance on nearly any other popular video site on the web to see if that heuristic is a good one?
Or maybe changing page layout in an extremely common way wasn't an effort to undermine a hyper specific benchmark?
How many sites put invisible DOM elements over the videos?
Remember, if you put visible DOM elements on top of the videos, then you lose scanout compositing no matter what.
4 replies →
On the other hand, pretty easy how such a div might trigger a less efficient path; if the video is top in the z-order then it can probably bypass being composited by the browser (and who knows, maybe even bypass being composited by the OS) and avoid a whole mess of rendering to a texture, texturing some triangles, and so on and so forth.
ha, just saw your story over on ars.
FWIW, I think you're a little credulous there; as I mentioned in my other comment[1], I can't find anything stating that Chrome starting beating Edge at the test (their videos actually claim the opposite) or anybody from Chrome boasting about it (articles from the time like yours[2] also say the opposite).
> On the other hand, pretty easy how such a div might trigger a less efficient path
I mean, sure, you can always fall off the fast path, but given how common transparent divs over video are, the battery benchmark should have come with even more caveats. Edge is the most battery efficient browser†!
† for playing fullscreen video††
†† Battery test not valid if the page doesn't use the exact layout youtube used in December 2017. Also not valid if testing vimeo, or twitch, or any porn site, or...
[1] https://arstechnica.com/gadgets/2018/05/edge-still-boasts-be...
I don't think the performance claiming is really the important part here; it's doing something that lacks any real reason but which hurts Edge.
And while I agree that video overlays are common, I also think it's reasonable for such overlays to revert to a slightly less efficient path.
4 replies →