Live data from Hacker News

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

bugzilla.mozilla.org

161–170 of 443 posts

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

#162
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."

oh i saw this happen to me the other day, i was wondering if it was a new youtube feature or something. can't say i care for it.

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

#163
post #3

I would like anyone that considers Microsoft to be a recent champion of Open Source to reflect on corporate doublespeak. It's plausible that this bug was engineered as an attack on Firefox.

The WWEification of every discourse is the worst thing about $current-year

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

#164
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 one of the myriad reasons why I have a strong preference for Linux.

Something happens

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

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

#166

Quick napkin math of the wasted power : Firefox has ~300e6 users, let's assume the bug wasted 5 extra watts 4 hours a day. That's 250 megawatts saved, the equivalent of an average coal power plant. Because some Microsoft engineer missed a bug.

> That's 250 megawatts saved, the equivalent of an average coal power plant. Because some Microsoft engineer missed a bug. Are you sure you want to invoke this logic? Because following it through imagine the energy savings if Firefox users switched to Chrome.

I mean, sure, I could also just turn off my computer. Presumably people use Firefox for a reason, and making that a option use less energy is pure upside, and it's very interesting to see how big of an upside it might be.

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

#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.

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

#168

What apps other than Firefox might this have affected that badly (75% CPU usage)?

Defender (or other AV) can slow down a lot of things, but in terms of the exact way that Firefox ran into it, the other apps would be anything with a JIT. Well, a JIT that uses memory protection as a security measure, though that's very common. (After generating executable code, the JIT marks the pages as executable but non-writable, so an attacker can't change the code after it starts running.)

Although the V8 JIT stopped using this, at least in some configurations (?), for the stated reason that it's not perfect—another thread could sneak in and modify the executable code in between when it was generated and when it is protected in preparation for execution. They're instead planning to rely on memory protection keys, which should be faster and more robust, but are only available on some hardware.

JITs can show up in unexpected places. Regular expression engines will sometimes have a JIT.

So... I don't know?

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

#169
post #137

What apps other than Firefox might this have affected that badly (75% CPU usage)?

I would think anything with a JIT that is toggling the page protection for machine code many times a second, based on a very quick reading of the bug report talking about VirtualProtect calls and the processing of ETW events for them by defender.

I don't think anything is toggling them back and forth, it's just that a lot of chunks of executable code are being produced. But I could be wrong; maybe if you have space left for more code on a page, you'll toggle it off and append some new code, then toggle it on again.

My guess is that this would mostly come from inline caches (ICs), since they're typically small and a lot of them are generated.

Post reply on HN