What apps other than Firefox might this have affected that badly (75% CPU usage)?
Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
31–40 of 443 posts
Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#32What apps other than Firefox might this have affected that badly (75% CPU usage)?
> It also has a bug(?) which makes method calls 100x slower in PowerShell 7: https://github.com/PowerShell/PowerShell/issues/19431
Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#33Earlier 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.
> With a standard Firefox configuration, the amount of calls to VirtualProtect is currently very high, and that is what explains the high CPU usage with Firefox. The information that the most impactful event originates from calls to VirtualProtect was forwarded to us by Microsoft, and I confirm it. In Firefox, disabling JIT makes MsMpEng.exe behave much more reasonably, as JIT engines are the source of the vast majority of calls to VirtualProtect.
> On Firefox's side, independently from the issue mentioned above, we should not consider that calls to VirtualProtect are cheap. We should look for opportunities to group multiple calls to VirtualProtect together, if possible. Even after the performance issue will be mitigated, each call to VirtualProtect will still trigger some amount of computation in MsMpEng.exe (or third-party AV software); the computation will just be more reasonably expensive.
Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#34Earlier quoted context omitted.
Also worth noting that the "expensive platform feature" you refer to in this specific case means "writing to a file". Something as basic as this should be assumed to be fast on modern operating systems.
It is not a bug that there are overlooked optimizations in some platform features. Windows has a ton of slow features. Starting a process, for example, takes forever. It is the responsibility of application authors to write their performance-sensitive critical path in such a way as to avoid bogus platform behaviors. This goes for Linux, which has more than its fair share of brain damage, as well as Windows.
Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#35Really nice to see open collaboration between Mozilla and Microsoft development teams resulting in a net improvement for everybody.
Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#36I 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.
Have you any semblance of proof of this? By the looks of it took Firefox a few years to figure out what the repro was, they reported it to MS, it was (very) promptly fixed and they were warned that the syscall they were using isn't being used as intended and they should consider changes to FF for future use cases.
Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#37Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#38Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#39Re: Microsoft fixes 5-year-old Defender bug, reducing Firefox-related CPU use by 75%
#40That's 250 megawatts saved, the equivalent of an average coal power plant. Because some Microsoft engineer missed a bug.