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.
- 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 is less of a choice and more of an actual issue that was left due to negligence. Hardly similar.
Ironically, Mac users routinely complain about how power-hungry Chrome is on the Mac. Safari is significantly more efficient.
Based on the increased laptop battery life I notice, so is using Edge on Windows.
It makes sense that both Apple and Microsoft can extract the best out of their OS + browser. There's no way Firefox can compete on such OS specific optimizations.
Entirely serious question. Apple is known to severely privilege their own applications over competitors.
> imagine the energy savings if Firefox users switched to Chrome.
Imagine the privacy savings if Chrome users switched to Firefox.
Imagine the energy squandered on all the extra goods and services bought by users using a browser owned by an advertising company, instead of Firefox.
Nah, I like my privacy. How about replacing Electron apps with native apps instead?
i've read everywhere that Firefox at this point is far more energy efficient than Chrome...is that not true?
In seriousness, though, this is an issue. Elsewhere, I observe arguments about eg userbenchmark rankings, and the comparative relevance of single-core vs multicore performance. Are you playing a game, or rendering video 24/7 -- or running some entirely synthetic workload that allows for a peak performance the real world would never achieve? Same kinda problem.
The reason it is not “invoked” is because energy prices are sufficiently low (due to not pricing in externalities) that there exists little incentive for end users to optimize for power usage.
You're right in principle, but in practice even factoring in externalities electricity prices won't be high enough for people to care. Using current US carbon intensity for electricity generation[1] and the higher end estimates for the social cost of carbon[2] gets us carbon costs of $0.142 per kWh. The average prices in US is $0.168. Adding in carbon costs would almost double the price, but there are countries with even higher electricity prices[4] and they're not exactly switching to more efficient software in droves to save energy.
[1] https://emissionsindex.org/
[2] https://en.wikipedia.org/wiki/Social_cost_of_carbon#Carbon_p...
[3] https://www.bls.gov/regions/midwest/data/averageenergyprices...
[4] https://www.statista.com/statistics/263492/electricity-price...
Imagine the power savings if everyone used pihole, ublock etc.
Second uses more power than the first and is better. Do it!
The optimum is likely somewhere where most people use the currently most efficient solution and others keep alternatives alive and competitive.
In switching browsers, you get different features, workflows and functionality, many of which you prefer on Firefox, which is why you’re using it.
With this bug fix, there is absolutely no loss or change in functionality (other than increased battery life), and yet you’re getting the benefits.
This bug is pure waste.
Far worse due to privacy/adblock addons.
This is why I left firefox.
And then imagine Safari on an M1.
Enlighten us.
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 large scale apps that are on millions of devices, hundreds of thousands of servers, or even just some back office guy who has minutes less stress in his day, performance benefits the world. For programmers, it’s one of the easiest ways to Save the Planet™.
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 velocity or whatever.
- Developers get new, fast devices (yay). We make our software just fast enough to run smoothly (enough) on our own devices. Then we ship it.
- Users' computers are slower than the developers' computers. Users experience is bad because the software is slow.
- Users buy new computers too. Money is poured into R&D for even faster computers.
- Hardware companies release faster hardware
- Developers buy new, fast computers
And the cycle continues.
For general purpose computing, there's not really any meaningful difference between my computer today and my computer 15 years ago. But I can't use that old computer, because modern programs don't work well on it any more. I can't imagine how slow modern Discord or Microsoft Teams would run on my old 2012 macbook air - even though that machine is orders of magnitude faster than the computer I was using to chat on IRC in the late 90s.
I'm low key convinced that if computers and phones stopped getting faster tomorrow, the software industry would grumble but get on with things and adapt. Users wouldn't really notice anything change, except we'd all be richer because we would no longer need to buy new computers every few years.
There's a few notable exceptions of course: modern AI, video production & animation, and massive cloud services (like Google and Netflix) who actually optimize their code. I'm on the fence about compilers - do LLVM & rustc really need to be that slow? Netflix might never make it to 8k video (boo hoo). And ray traced video games might not happen. But the average consumer would probably be delighted. And the savings to the environment would be insane.
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.
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.
In some cases you convince your organization to shift focus onto more useful products, and that can be a really great feeling. In other cases (company is too large, management too committed) it helps you confront exactly who you're working for. Because if you're going to sell your soul, you should at least make sure you're getting a good price.
… anyway…
Why make the world worse for ourselves and our children when you have other options?
Pardon me, I think there are some electron devs at my door asking for a word. They might have baseball bats.
That's about 2.2 TWh per year. A decent estimate for average worldwide CO2 intensity of electricity is 400 gCO2e/kWh (that's 400 tons per GWh). A typical personal footprint including some international flights will be in the tens of tons.
Who knows what edge case triggered that bug to manifest but I for one haven't seen it in the wild in the years we've been using FF.
Probably difficult in such a large org to allocate dev resources to chase down and fix a bug few people were impacted by.
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 proportion of Windows users you assume were actually affected. Not a whole coal power plant, but nothing to sneeze at.
I don't like video games and they are not-necessary so I propose that we ban them globally, or only allow gaming if using renewable energy. If you don't live in a place where this is an option, too bad!
Maybe instead of this we require all games to be limited in graphical effect (imagine early source games or something). We could save a lot of power globally if we enforced this.
This is why I strongly dislike this line of thinking. I don't think power plants work that way anyways, they probably make a constant-ish amount of power rather than taking exactly 50w worth of fuel every time someone opens up Call Of Duty.
There are also much lower hanging fruit to get upset about if you care about the planet, like cars with large motors or people with heated drive ways (yes thats a thing).
My intention was to compare the listed things against MicroSoft engineers making mistakes while programming Windows Defender (the quote below), or programmers writing bugs in general.
>Because some Microsoft engineer missed a bug.
That's not how power or energy works.
5 [W*hr/day] (Kept in energy units per interval rather than average power).
200e6 users/day who surf for maybe 4 hours/day
5 * 200e6 * 4 / 24 = 133 [MW*hr/day] (133/24 = 5.5 MW)
A typical US home uses 11 [MW*hr/y] or 0.36 [MW*hr/day].
(Convert to power draw, that's 0.015 MW.)
mean consumption of roughly 400 US homes (133 / 0.36).
The smallest US grid-tied operational nuclear power plant produces 600 MW. 133 MW very small coal power plant would 400 MW.
5W/user * 200e6 user * 4h/24h = 167 MW
11 MWh/a/home = 0.00125 MW/home
167 MW / (0.00125 MW/home) = 133 000 homeUnfortunately devs dont realize how needlessly power hungry software is when they don't need to be. But hey, its easier to use electron and javascript than it is to save the planet.
How did you come to this?
That might be a bit too kind given how much Google liked to Oops Firefox. Wouldn't be surprised if MS did too.
Oops:
https://www.computerworld.com/article/3389882/former-mozilla...
Produces in an hour, four hours?
300 million users * 4 hours/day * 5 watts = an average continuous savings of 250 MW.
"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."
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.If anything redirect the frustration to the leadership that doesn't prioritize fixing these kinds of errors.
If you are tech savvy, you are then expected to be able to "bear the burden" of turning the feature off if it bothers you
Then again, I am using a real computer and not a toy.
Total speculation, but Firefox seems to be pushing out a lot of UI gimmicks. Maybe they're trying to drum up interest in the browser that way, since they seem intent on killing many of their other differentiators.
This sounds like it should be relatively cheap if composition is properly accelerated.
the best way to make youtube videos more immersive is to block obnoxious advertisements, remove useless algorithm-driven recommendations, and delete the comment section
When done right, sure, they improves the user experience by some percentage. But when done badly, the UX goes down by orders of magnitude.
> The iPhone 15 Pro and Pro Max will use a new ultra-low energy microprocessor allowing certain features like the new capacitive solid-state buttons to remain functional even when the handset is powered off
[1]: https://www.macrumors.com/2023/03/20/iphone-15-volume-mute-b...
Run your own alternate frontend - https://github.com/iv-org/invidious
> This is one of the myriad reasons why I have a strong preference for Linux.
Feel free to tell me I'm a sell-out, I am happy to be one today.
Glad you like your machine.
Honest question. If you could get that on Linux, would you? and what kind of pricing would you consider reasonable? Is it something that would have to come with the computer (i.e. would you pay for it separately or would you only use it if it was "free" aka included with your laptop purchase)? Did you stick with the vendor-provided install or did you wipe and install your own preferred distro?
(brew addresses a lot of the issues though, even if I do have to remember to run gdu instead of du (for gnu du))
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.
* Corporate doublespeak is a well documented tactic in which a business will project a message when the truth is the opposite of the message. Sometimes they use euphemisms, ambiguity, or omissions. I am stating that we cannot take Microsoft's press releases about being Open Source friendly at face value.
* Five years ago Edge was rebuilt with a chromium backend and Microsoft had a large campaign to increase adoption of Edge.
* Reduced Firefox performance would make Edge compare more favorably. This error was clearly in Microsoft's favor.
* It is common for companies that own a platform to create advantages for their applications running on the platform.
* Microsoft has a long history in the browser wars, highlighted by an antitrust lawsuit in the late 90s. Their anticompetitive behavior regarding browsers was a key part of the lawsuit.
Except you don't have any proof, and the proof that opposes your wild speculation is:
- 5 years ago, a bug was opened on the FF issue tracker that over the years had a bunch of derailments.
- A month ago, someone _actually_ investigated, found an issue and reported it to Microsoft.
- Issue was promptly fixed
You're spreading FUD, and attacking _me_ for asking for proof when you made the accusation in the first place. If you want to discuss this reasonably, I'm happy to, but in order to do that, the slightest modicum of bait that points to any sort of effort is required, meanwhile to someone who has worked on software for a reasonably long time, seeing issues spin like this for years is par for the course, and it's great that someone fixed it.
> Have you any semblance of proof of this?
Does it need proof? Someone can make a statement like this solely based upon past behavior. They're merely stating that it is plausible.
Yes, it does. Stringing together a narrative and ignoring the proof that contridts your claims is conspiracy theory territory.
> Someone can make a statement like this solely based upon past behavior. Yet all the evidence (the bug linked) implies nothing of the sort.
> They're merely stating that it is plausible.
I can state that it's _plausible_ that the US government conspired with Disney to fake the Moon landing as a show of power to the USSR in the 60's, but I'd expect to be asked for proof, and I'd expect to be accused of spreading absolute nonsense.
> This problem has two sides: Microsoft was doing a lot of useless computations upon each event; and we are generating a lot of events. The combination is explosive. Now that Microsoft has done their part of the job (comment 82), we need to reduce our dependency to VirtualProtect.
(https://bugzilla.mozilla.org/show_bug.cgi?id=1441918#c90)
Compare how many calls other browsers make (this is also quoted in the link): Firefox was generating up to 46 times more (costly) events than Chrome. It is a bit ludicrous to shame Microsoft for the whole situation.
> Firefox with normal configuration: ~14000 events, 98% of which are PROTECTVM_LOCAL;
> Firefox with the preferences from comment 83: ~6500 events, 95% of which are PROTECTVM_LOCAL;
> Edge: ~2000 events, 91% of which are ALLOCVM_LOCAL;
> Chrome: ~300 events.
Microsoft has a storied history of anti-competitive views leaking to public eyes/ears, something like this is quite literally a matter of not organizing anyone.
See: Microsoft's Supreme court case over their preference for IE and forced monopoly. While Microsoft 'won' the case, the outcomes were exactly what the case feared but "convenient" political climate helped them avoid travelling back to court of course. Microsoft took extreme steps to avoid being broken up in the 1990s however and it's arguable that one of their political mitigation methods, investing in Apple, actually had worse effects on them. (Prior to the iPhone in 2007, it was assumed that RIM and Microsoft would be the big two players in the smartphone space, Apple and Google have basically become the big two players in the Computing space mindshare)
https://en.wikipedia.org/wiki/United_States_v._Microsoft_Cor....
One of the first, hard lessons I had to learn about web development (like, stare-at-a-wall-and-consider-my-career-hard) is that web development is way more about network effects than application architecture.
Real people run systems with real configurations, and when you're targeting "the public" as your userbase you must account for that. And Mozilla knows this: if you go into the source code (circa 2009, YMMV) and look through the initialization and boot-up logic, you would find places where the system used heuristics to figure out whether some extensions had been installed in odd places instead of the "Extensions" directory (because the tool had been installed before Firefox) and hot-patch paths to pull in that component. Because if a user installs Flash and then installs Firefox and Flash doesn't work in Firefox, it's not Flash that's broken... It's Firefox.
It doesn't matter if the bug is in "Microsoft's code" or "Mozilla's code." That's unimportant. If you're a Mozilla engineer, all that matters is whether this bug would cause a user to get pissed off and uninstall Firefox.
Thats. All. That. Matters.
"They shouldn't have written so many files in the first place" is not a valid preventative strategy, but a one way road to premature optimization hell.
I worked on a desktop<->cloud file sync app. On Windows, only one badge can show up on a file's icon in Explorer. If there's multiple apps trying to set the badge, who wins? Well, it depends on the lexicographical order of the registrants names. So what did we do? We added some spaces to our registration name to make them show up first. Good for the user, as best as we can know - since the user or their admin had to install the app to get these badges in the first place. And they were useful ones too - whether a file was synced or not. We tried our best, and escalated.
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?
The docs for that function don't say anything about performance: https://learn.microsoft.com/en-us/windows/win32/api/memoryap...
They also don't say anything about "sane" usage, and while I don't have an MBA, I'm pretty sure they don't teach anything about `VirtualProtect` ratios when doing competitor analysis.
One possibility is that the Chrome team's implementation was more efficient due to luck, or they invested the resources to identify the performance characteristics of this function call, whereas the Firefox team missed it. I don't think "Chrome has more development resources than Firefox" is news to anybody.
Windows Defender isn't "arbitrary software" - it's built into the OS and enabled by default. To anyone building an application for Windows, it should be considered part of the platform.
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 size of a buffer.
That's an educated guess... that is unfortunately very easy to disprove :(
Malware protection algorithms make fools of us all.
The bug was in ETW, which just happened to surface in a windows utility that ostensibly protects you from malware.
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
> It also has a bug(?) which makes method calls 100x slower in PowerShell 7: https://github.com/PowerShell/PowerShell/issues/19431
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?
My guess is that this would mostly come from inline caches (ICs), since they're typically small and a lot of them are generated.
Under Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus
- Turn off Microsoft Defender Antivirus -> set to Enabled
Under Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus > Real-Time Protection - Turn on behavior monitoring -> set to Disabled
- Monitor file and program activity on your computer -> set to Disabled
- Turn on process scanning whenever real-time protection -> set to Disabled
- Turn on behavior monitoring -> set to Disabled
Restart the computer and Real-time protection should be disabled permanently (until you reverse the same settings through gpedit.msc at least).Alternatively, if you run windows server as your workstation OS, you can perform an uninstall using Remove-WindowsFeature from powershell.
The old gpedit tricks don't really work anymore in my experience.
Having everyone easily disable Windows Defender will not lead to a great outcome.
There's a reason malware on Windows has been on a steep decline from the Windows XP days and I'd prefer it to keep it that way.
Their solution? Make it intentionally complicated, but still possible:
Step 1: Turn your headlight switch off
Step 2: Unbuckle your seatbelt and turn the key to the off position
Step 3: Turn your key to the on position till the seatbelt warning light turns off
Step 4: Buckle and unbuckle the seatbelt three times and end on the unbuckled position
Step 5: Turn your headlight switch on for three seconds and then turn it off
Step 6: Repeat step number 3
Step 7: Wait for the seat belt warning light to turn on and off again then buckle and buckle the seat belt
I really only use this machine for MWII, Halo and Titanfall. It's a glorified Xbox. I even contemplated putting it on a standalone VLAN to 100% physically isolate it from my core net.
I'd be grateful for an overview of the bug. I don't think I've seen it on my two systems but I can't be confident.
I think it'd be more convenient (for me as a keyboard centric user at least) if it were done differently but I don't think it's actually a bug as much as an intentional decision at the cost of keyboard user. This is unlike the Defender issue where it's of no purpose to be significantly slower than it needed to be.
I often accidentally rename files in macOS Finder (hitting Enter activates rename).
The problem is that there is zero incentive to get them right. Nobody is going to get promoted because they use 10% less CPU. Nobody is losing their bonus because 10% of all computers melt down. etc.
Which, in my experience, isn't far from the truth.
Other people think so too: https://caseymuratori.com/blog_0025
Really nice to see open collaboration between Mozilla and Microsoft development teams resulting in a net improvement for everybody.
IIRC, a couple of patches did get submitted, but never accepted for unknown reasons.
To be clear: I'm aware Windows Defender updates itself independently of Windows Update, and I actually don't mind and even appreciate this behaviour since Defender updates almost always aren't intrusive unlike the rest of Windows Update.
Just an FYI for people with similar configs.
a) That'd be a very untargeted way to get that effect; Firefox isn't the only app that's going to be making calls like that.
b) Mozilla doesn't need any help losing marketshare in this era.
There was a MDE bug that caused Chrome to crash whenever dragging tabs.
Another time, MDE also appeared to "remove" all of some users apps when it deleted shortcuts.
I wonder whether this situation with Microsoft Defender cost Firefox some market share.
I really have no clue why engineer at ms think such behavior is ok. Shouldn't scans like these scheduled at some time slot that people are not actively using computers?
If you reduced something to zero, you reduced it by 100%.
Firefox engineers discover a Windows Defender bug that causes high CPU usage - https://news.ycombinator.com/item?id=35458746 - April 2023 (215 comments)
Is the current post significant new information* or just a repeat of that submission?
* https://hn.algolia.com/?dateRange=all&page=0&prefix=false&so...
Careful to talk about how this is entirely a fix for Windows and will improve the experience of folks using other software, not just Firefox.
That bug is more subtle. Apparently the various ways to use VirtualAlloc is not self evident, and some variations have wildly different performance characteristics due to undocumented interactions with Event Tracing for Windows (ETW) events that get sent to anti virus products.
So it's not only the original problem of the events being handled inefficiently, it's also that the way they're generated is a bit of a black box and hard to predict without detailed performance tracing work.
But if you use Firefox to call yourself on Chrome... you'll see that Firefox takes up a TON more energy on an Intel MBP than Chrome does.
You can tell because Firefox literally heats your laptop up to do streaming videos. You hear the fans kick on, the laptop gets hotter to hold.
Anyway I'm sure there are more bugs like this! Glad Firefox is getting some of the people to fix their code... but look, Microsoft isn't the only culprit. Until Firefox takes as little power as Chrome in MacOS & Windows... I think we should all stay outraged! (=
https://news.ycombinator.com/item?id=35458746
@dang
Only keep a license around for the occasional gaming session. Disable all of the Windows features (ie, firewall, auto updates, antivirus) and telemetry. Strip the OS to bare minimum and manage the GPU, mobile drivers manually. Limit it to only games