[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/vt/ - Virtual Youtubers

Search:


View post   

>> No.10884307 [View]
File: 1.49 MB, 2556x1336, Screen Shot 2021-10-05 at 19.22.05 .png [View same] [iqdb] [saucenao] [google]
10884307

>>10882960
>>10882855
>>10882798
left is a twitch chat comment, right is a youtube chat comment. the size alone should give you a hint, but it gets so much worse.

the bottom half of the twitch chat comment is for handling the "reply" button that pops up when you hover over the message, it has no impact on layout or paint unless you're hovering over it, meanwhile everything in the youtube side affects layout and paint.

youtube also has 2 <img src="https://......"/> elements. Each of those an image file that needs to be fetched from Google's servers using a network request, so you can see the user's profile picture. The way twitch handles it is with a <style="rgb(...)"> element, which just applies the user's chosen color. The difference between one style tag and two image fetches is astronomical.

On top of that, all the youtube elements have an id and a class, whereas most of the twitch elements just have a class. It's not a problem by itself, lookups by id or class are just as fast, but it does suggest that google has two stylesheets competing to style the chat comment - it has to get whatever is in the style for that class, and whatever is in the style for that id, and combine them together.

youtube is also using the fucking obscure shadowDOM functionality, because google are assholes and spent a shit ton on optimising shadowDOM in Chrome so that Google's websites would run faster in Chrome than in other browsers. However, shadowDOM still runs slower than regular CSS, it's just Chrome goes down to 90% where everyone else goes down to 50%. Side note: I wouldn't be surprised if this shadowDOM shit is why youtube leaks so much fucking memory. Create a shadow root with some CSS for each chat comment, and then when you remove the chat comment its associated shadowDOM is orphaned in memory. Given that Chrome has optimised shadowDOM much more than anyone else, I would bet this is one of their big tricks to make their websites run slower in browsers they don't own.

Fuck I hate google so much

Navigation
View posts[+24][+48][+96]