Live data from Hacker News

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

bugzilla.mozilla.org

191–200 of 443 posts

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

#191

Earlier quoted context omitted.

I love calculations like this and hope they are part of every engineer’s line of thinking. I originally came across this thinking in Andy Hertzfeld’s book - https://www.folklore.org/StoryView.py?story=Saving_Lives.txt Performance is time, energy, heat. It’s one of the easiest features to get and there are lots of tools, research, and philosophies to help get it. Memory and storage are similar. For anyone working on l…

It can be a bit dangerous (especially to your employer) to continue that line of thinking, though. How many pieces of software do we collectively work on which would make the world a better place if they didn't exist at all ?

Meh. I feel like there needs to be an active movement to assess programs that have huge scale (>10m users) to identify unnecessary power usage - whether it be because of a bug, because of unused functionality that nonetheless takes resources, or intermediate steps that take unnecessary power.

Perhaps I’m getting into a bit of a niche here, but the rise of stringy formats for data transfer concerns me. There are many-stage pipelines on machines that agree on what a 64 bit integer is, yet each stage performs encoding and decoding of JSON twice (decoding upon receipt, encoding to pass it on to the right place, decoding the response, encoding it in another manner to reply to the original sender). Sounds like a minor concern, but the scale of this instinctively feels like it’d dwarf 250MW globally.

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

#192

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.

Using firefox without memory errors is a pareto optimization over using firefox with memory errors.

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

#193
post #181

Earlier quoted context omitted.

Neat idea, I bet the intern had fun implementing it, why was it on by default?

This seems unnecessarily passive aggressive. Everyone makes mistakes or bugs, intern or not. It makes no sense to get this salty about basic human error. Also there's nothing wrong with implementing minor UX enhancements. If anything redirect the frustration to the leadership that doesn't prioritize fixing these kinds of errors.

It's not unreasonable to hold YouTube devs and QA engineers to a higher standard than everyone else who doesn't work for a ~trillion dollar corporation or deploy code that runs on billions of devices.

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

#194

Earlier quoted context omitted.

I love calculations like this and hope they are part of every engineer’s line of thinking. I originally came across this thinking in Andy Hertzfeld’s book - https://www.folklore.org/StoryView.py?story=Saving_Lives.txt Performance is time, energy, heat. It’s one of the easiest features to get and there are lots of tools, research, and philosophies to help get it. Memory and storage are similar. For anyone working on l…

Don't forget the waste caused by people throwing away devices that are "too slow", and the resources required to build new computers/phones. Somewhere I saw a rough figure about phones. Something like: if everyone was able to keep their phone one year longer, it would be the equivalent of 600,000 cars off the road or something. (Just looked it up - source is possibly the founder of iFixit). But you know, development…

Actually, in the PC/laptop space, I believe this phenomenon has been waning somewhat over the past... oh, the better part of a decade.

This is a result of:

* Single-core performance no longer dramatically improving - almost plateauing

* The rate or extent of "bells and whistles" and other OS overhead being added - decreasing.

* Budget consumer CPUs having reached smooth desktop performance (with sufficient memory and and an SSD) already, even with multiple applications open.

.. and all of these had not been the case during the 1980s, 1990s and 2000s. Now, if your machine's hardware doesn't brake down - and you're just a plain desktop user - your motivation for throwing away your machine is quite limited.

---

Of course, this is not the case for smartphones, we're still on the roller-coaster there.

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

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

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, for pennies a day. You can't get that on Linux!

Feel free to tell me I'm a sell-out, I am happy to be one today.

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

#196
post #181

Earlier quoted context omitted.

Neat idea, I bet the intern had fun implementing it, why was it on by default?

This seems unnecessarily passive aggressive. Everyone makes mistakes or bugs, intern or not. It makes no sense to get this salty about basic human error. Also there's nothing wrong with implementing minor UX enhancements. If anything redirect the frustration to the leadership that doesn't prioritize fixing these kinds of errors.

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 out how the choice to turn this on by default should have been more nuanced and thought through.

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

#197

Earlier quoted context omitted.

I love calculations like this and hope they are part of every engineer’s line of thinking. I originally came across this thinking in Andy Hertzfeld’s book - https://www.folklore.org/StoryView.py?story=Saving_Lives.txt Performance is time, energy, heat. It’s one of the easiest features to get and there are lots of tools, research, and philosophies to help get it. Memory and storage are similar. For anyone working on l…

It can be a bit dangerous (especially to your employer) to continue that line of thinking, though. How many pieces of software do we collectively work on which would make the world a better place if they didn't exist at all ?

Oh no!

… anyway…

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

#198
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,…

You're a sellout but I am too, so welcome :).

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

#199

Earlier quoted context omitted.

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

It's not too bad an analogy. Think of it this way: - Switching from Firefox to Chrome might be similar to switching between two car models, one consuming less energy than the other. - Fixing this bug is more like going to a car workshop to fix an injector issue in your car that was causing higher fuel consumption and more pollutants. The first one is really a matter of tradeoffs and personal choices. The second one i…

Isn't it more like an auto maker issuing a recall to fix an injector issue in all their cars?

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

#200
post #121
post #77

Earlier quoted context omitted.

No it had nothing to do with Firefox writing files. Firefox was making a bunch of calls to VirtualProtect. Windows Defender (MsMpEng.exe) was then writing to file (an sqlite database) every time one of these calls was made, which was slowing down the system. This comment is a good summary of what the issue was once they understood the problem: https://bugzilla.mozilla.org/show_bug.cgi?id=1441918#c82

Where did you get that idea? Sqlite? Windows Defender isn't using sqlite at all.

It detects the use of SQLite, then copies it, etc etc. Read the bug for more details.
Post reply on HN