What on the YouTube home page could possibly require 12MB of JS alone? Assuming 60 characters per line, that’s 200k lines of code? Obviously ballpark and LoC != complexity, but that seems absurd to me.
https://developer.chrome.com/docs/lighthouse/performance/thi...
YouTubes frontend people just don't care about bloat, even when other Googlers are yelling at them to cut it out.
all of the code that hoovers up your analytics on what's been looked at, what's been scrolled past, etc. maybe I'm just jaded, but I'd suspect so much of it is nothing but tracking and does little for making the site function
The code is minified so there's relatively few characters for each source line, if you run it through a pretty-printer to restore sensible formatting then it turns into well over half a million lines of code.
That doesn't affect page speed scores if the video is "below the fold", and that's all that I really care about. If Google Lighthouse doesn't complain about it, then my job is done.