Live data from Hacker News

Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

bugzilla.mozilla.org

241–250 of 443 posts

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#241

Earlier quoted context omitted.

Around 80% of Firefox users are on Windows, per https://data.firefox.com/dashboard/hardware That same site also suggests that Firefox has around 200e6 monthly active users, the average user uses Firefox 3.5 days a week, and for 5.5 hours per day. My math could be wrong, but taking the above into account, and arnaudsm's 5 W estimate, I come up with an upper bound of around 80 MW. Discount that further by whatever prop…

Wow, that's fascinating. It really speaks to the utter dominance of Windows over Linux more than anything else. Like even among Firefox users, as of last year , there were an order-of-magnitude more Windows 7 and 8 users than Linux 5.x users.

Don't have any data to back this up, but I would think that the average linux user will instantly turn off firefox telemetry and won't show up on these graphs. It's one of the first things when I install firefox, disable ff telemetry, set privacy mode to strict and then install uBlock. Nevertheless Windows has a huge market share, even if no one turned off data collection, and the year of linux on desktop didn't happen.

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#242

Earlier quoted context omitted.

To save a search: "Ambient mode uses a lighting effect to make watching videos in Dark theme more immersive, by casting gentle colors from the video, into your screen's background."

The "average color" (or whatever it is) could have been pre-computed server-side rather than tiring out the poor innocent client CPUs.

But then Google would be responsible for that one-time computation instead of making the clients do it billions of times.

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#243
post #167
post #143

If you're on a Mac and using FF (probably not FF specific), turning off "ambient mode" in youtube can save 30% cpu. I just found this out while searching why FF was taking 90% of my cpu while watching youtube videos in normal mode, but went down to 40% use if viewing in full screen. Turns out that this youtube "ambient mode" was the culprit. My lap is now cooler and the fan doesn't turn on anymore. I wonder how much…

This is why I like terminal, rss, or other technologies where it’s hard to add this kind of fireworks to the UI. When done right, sure, they improves the user experience by some percentage. But when done badly, the UX goes down by orders of magnitude.

If you turn off your computer power usage goes to 0% too.

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#244

Earlier quoted context omitted.

I don't think there's any error to fix. It's a feature - casting light from the video onto the UI, using JS, surely takes that amount of CPU. The question of why it is on by default stands - because it's little bit of eye candy, vs people's laptop batteries, CPU that could have been used to get other stuff done faster - so also their time, device thermals etc... I don't think it's just unnecessarily salty to point ou…

IMO the implementation sucks and the feature is questionable. Recently I set the browser to dark mode, which tells YT to also use dark mode, and if I haven't read here I wouldn't know that this is a toggleable feature. It's sad when we can't tell a feature and a bug apart.

Not being able to distinguish between a feature and a bug is a feature, not a bug.

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#245
post #195

Earlier quoted context omitted.

This is one of the myriad reasons why I have a strong preference for Linux.

I just bought a Macbook because my dedicated Linux laptop, made by a popular Linux-only manufacturer, had so many issues that I got tired of diagnosing. I love Linux, but it's not a panacea for every computer issue under the sun, just a few of them. I, personally, am stoked I no longer have to deal with issues with this new machine, and can just take it into a Genius bar appointment to let someone else deal with it,…

With all the attention being paid to macOS these days, there's enough mods and addon's that I don't miss Linux so much on my laptop. Hammerspoon gets me drag and resize windows how I want, and there's Rectangle.app for tiling-ish window management. There's no /proc, and all the rest of the cli utilities are just wrong (netstat, route, top, etc) but I can live with my M1.

(brew addresses a lot of the issues though, even if I do have to remember to run gdu instead of du (for gnu du))

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#246
post #143

If you're on a Mac and using FF (probably not FF specific), turning off "ambient mode" in youtube can save 30% cpu. I just found this out while searching why FF was taking 90% of my cpu while watching youtube videos in normal mode, but went down to 40% use if viewing in full screen. Turns out that this youtube "ambient mode" was the culprit. My lap is now cooler and the fan doesn't turn on anymore. I wonder how much…

To save a search: "Ambient mode uses a lighting effect to make watching videos in Dark theme more immersive, by casting gentle colors from the video, into your screen's background."

To save another search:

On desktop and mobile devices:

    While playing a video, select the Settings button.
    Locate the Ambient Mode setting in the list of preferences.
    Toggle it to off to disable Ambient Mode for all videos on YouTube (in that browser).
It's in the same popup used for video quality and playback speed.

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#247

Earlier quoted context omitted.

The "average color" (or whatever it is) could have been pre-computed server-side rather than tiring out the poor innocent client CPUs.

But then Google would be responsible for that one-time computation instead of making the clients do it billions of times.

They could do it on a few clients then ship the data back to the server. If they’re resourceful those clients don’t even need to be watching the video! (they could send it and compute the output in the background of another stream)

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#248

Earlier quoted context omitted.

I'm not sure how you can possibly qualify VirtualProtect as "an expensive platform feature". Looking at the operation that VirtualProtect actually has to perform, from first principals, it should be one of the cheapest syscalls in the entire kernel. The bug was that ETW (in the antivirus process) was doing something braindead; zeroing a megabyte of memory unnecessarily every time someone called it just to get the siz…

> it should be one of the cheapest syscalls in the entire kernel. That's an educated guess... that is unfortunately very easy to disprove :(

Exactly. If you're going to assume some call is free, write that down in a test that can be periodically verified and, preferably, is.

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#249
post #26
post #19

Earlier quoted context omitted.

> I don't think it's the FireFox' team's responsibility to be aware of and take into account arbitrary software intercepting system calls. Per the bug report, Firefox was generating up to ~14,000 calls where Chrome was generating ~300, though. Surely it is Firefox' team's responsibility to use system calls in a sane way, say not almost 50x more than the competition?

Did you read the bug report? This is literally about writing to files in a temp folder. Surely you can optimize that but you should also be able to assume that this does not use excessive amounts of CPU on a modern operating system.

Come on, anyone that has even unzipped Linux-centric stuff on Windows knows how slow individual file operations are compared to Mac or Linux.

It's very common knowledge that on Windows you will get terrible performance if you have many many small files.

I don't know why Microsoft doesn't fix that. Maybe they can't for compatibility reasons or something. But that's the way it is, and any software that wants to run well on Windows needs to deal with it by using fewer bigger files.

Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%

#250

Earlier quoted context omitted.

To save a search: "Ambient mode uses a lighting effect to make watching videos in Dark theme more immersive, by casting gentle colors from the video, into your screen's background."

The "average color" (or whatever it is) could have been pre-computed server-side rather than tiring out the poor innocent client CPUs.

Couldn't this be done cheaply on the GPU?
Post reply on HN