Live data from Hacker News

Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

news.ycombinator.com

91–100 of 133 posts

Re: Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

#91
Tangially related; imgur uses (and used) 100% CPU for me; I was never quite sure how or why.

The reason I bring it up is because I tried to actually profile it a handful of times, but my C++/Rust/Python knowledge was completely useless in the face of a browser development toolchain.

Did I miss something, or is it not possible to easily see what functions take the meat of javascript execution time?

(it feels really absurd if it's not easy, given that people can essentially serve whatever arbitrary script they want and my computer pretty much has to deal with it if I want to use whatever site)

Re: Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

#92
post #91

Tangially related; imgur uses (and used) 100% CPU for me; I was never quite sure how or why. The reason I bring it up is because I tried to actually profile it a handful of times, but my C++/Rust/Python knowledge was completely useless in the face of a browser development toolchain. Did I miss something, or is it not possible to easily see what functions take the meat of javascript execution time? (it feels really ab…

Run the profiler in the browser’s developer tools and you get a flame graph.

Re: Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

#94
post #31

Earlier quoted context omitted.

I run an extension that allows to automatically request h.264 streams from YouTube even when av1 is also available. Saves a lot of CPU, at the cost of some bandwidth.

What's the name of the addon? I recall h264ify but not sure about it

What I run is https://github.com/alextrv/enhanced-h264ify

I looked now and noticed that I actually reject VP8 and VP9 and accept AV1. I run Linux on a Ryzen 4750U, for the record. It did not have trouble chewing through VP8 / VP9 without skipping frames, but it ran unpleasantly hot.

Re: Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

#95

Youtube has been turning on AV1 for 1080p content for me. My phone is the only device with an AV1 hardware decoder. The impact on battery life and CPU usage has been extreme. You can tell Youtube to prefer AV1 only for low-quality videos ( https://www.youtube.com/account_playback ) or you can install an extension that will force h264 playback where supported. Other playback features such as ambient mode and volume eq…

> You can tell Youtube to prefer AV1 only for low-quality videos (https://www.youtube.com/account_playback)

What option are you referring to here? I don’t see anything that seems related to that.

Re: Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

#96
post #56

Earlier quoted context omitted.

I believe Youtube's player is driving codec selection, not the browser (i.e. the player requests a list of supported codecs and then picks the one most beneficial for Google, not the other way around). That said, I've solved this problem for myself on macOS and Firefox by setting media.webrtc.codec.video.av1.enabled to false on about:config, as all other codecs used by Youtube are hardware accelerated on my Mac.

> I believe Youtube's player is driving codec selection, not the browser (i.e. the player requests a list of supported codecs and then picks the one most beneficial for Google, not the other way around). The way the browser can still participate in choosing is by e.g. not listing AV1 as supported when there is no hardware decoder on the local system. Both Safari and Edge took (approximately) that style of approach, b…

Yes, I think Safari even did so dynamically based on the mac being plugged into external power or not for a while, which I think is a nice compromise.

Apparently, there's even an API attribute that indicates whether a given codec is power efficient (https://developer.mozilla.org/en-US/docs/Web/API/MediaCapabi...), which Google must also be ignoring – not their problem, after all. (I wonder if anybody did the math of the opportunity cost of losing a few ad impressions due to the user's battery dying early vs. the incremental bandwidth cost?)

Re: Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

#98

A great (free and O.S.) Android client with ad blocker is https://github.com/polymorphicshade/Tubular it also integrates SponsorBlock!

Will Google ban your account if you login?

Just load your channel list from YouTube. No need to login.

Re: Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

#99
post #91

Tangially related; imgur uses (and used) 100% CPU for me; I was never quite sure how or why. The reason I bring it up is because I tried to actually profile it a handful of times, but my C++/Rust/Python knowledge was completely useless in the face of a browser development toolchain. Did I miss something, or is it not possible to easily see what functions take the meat of javascript execution time? (it feels really ab…

Run the profiler in the browser’s developer tools and you get a flame graph.

I think the issue is/was that the profiler in chrome never ends.

I'll just leave it like this (480s of samples..?): https://imgur.com/a/IgaHOdX and come back in a few hours.

Re: Ask HN: Does anyone else notice YouTube causing 100% CPU usage and stattering?

#100
As others have noted, if you don't have hardware decoding for the codec being used, it will suck up a huge amount of cpu. Last year I got a new Macbook Pro with M3 Pro cpu, and it's amazing how little cpu it uses for video playback. After watching an hour of Youtube, the battery is down only about 5 or 10%.
Post reply on HN