Updated: February 2, 2019
Well, well, I've encountered a new, interesting and - ultimately - annoying problem. On one of my Windows machines, I upgraded Firefox to version 65. Then I noticed that the close sequence for the browser takes a very long time. Previously, this would be a very short thing - 1-2 seconds max. Now, it was taking a whole minute and eating one core worth of CPU. So I decided to dig into this issue more deeply and figure out whether this is something in my own setup or a fresh issue in Firefox.
As always, the Internet wasn't very helpful. I had the usual slew of recommendations - update drivers, refresh this, refresh that. The worst kind of suggestions that completely ignore the problem or the reasons why it manifested. After all, if you don't understand the issue, making changes only masks the whole thing in the long run. To that end, I set about doing this the right way. Follow me.
Problem in more detail
What happens is as follows: you upgraded to Firefox 65, and now, closing the browser takes a full minute with heavy CPU usage. After that, the browser does close. In order to fully understand and isolate the problem, you should perform a step-by-step investigation of the issue, one component at a time. Here's what I did:
- Compare the closing of the browser using the UI window button, file menu and the Alt + F4 shortcut. Same thing.
- Restarted Firefox in safe mode with all the add-ons disabled. Same thing.
- I am using the wonderful EMET framework to harden the browser. Since I've already seen issues with Firefox and EAF/EAF+ mitigation (albeit on Windows 8), I checked this component next. I completely disabled EMET for Firefox, and again, this made no difference. The slowness and CPU hit on close stubbornly remain.
- I reinstalled the browser, to see whether this makes any difference. It didn't.
- I tested the 64-bit vs 32-bit versions. No change.
Now did anything help? Yes.
- I tried Firefox 64. No slowness on close down.
- I tried Firefox 60 ESR. No issue. The browser closes within 1-2 seconds at the most.
So this tells a simple and clear story - something is botched in Firefox 65.
Since I'm not in the mood to try to debug software - when I all want is a simple, seamless, painless experience, I decided not to bother with Firefox 65 any more, and I kept Firefox 60 ESR. The performance difference is minimal, and if you disable the Accessibility services in the browser (if you don't need them), you even get a slight, non-placebo boost. I tested against a variety of websites, and I did need to clear my cache and delete website data to make sure there are no weird warnings, like corrupt content whatnot. But other than that, things seem to be in order once more.
Turns out, Firefox 65 seems to be a particularly naughty release. Just yesterday, I read the automatic updates were stopped, paused or whatnot, because of an incompatibility with some third-party security software. Hey, I've always claimed that anti-x thingie stuff usually causes more noise than good, but I'm not here to argue a philosophical point. The combination of the performance problems and the certificate thingie leads me to believe this is just another data point on the silly graph of "move fast and break things" plague that has gripped the software industry in the past few years. Very sad.
Here we are. I would like to believe the close issue is actually going to be resolved gracefully in Firefox 65.X or whatever. My hunch - without going through the Firefox internals - is that this has to do with the new task manager, new memory management, whatever. Feels like garbage collection or caching gone rogue. But then, this is only a guess, if one made by a genius of supreme stature.
Over the past few years, Firefox has made a lot of strides, many of them in a completely wrong direction. But even with all its Australis and WebExtensions nonsense, we do need Firefox, because having a browser monopoly, which is virtually what's happening at the market right now, would be a really bad thing. A horrible thing. Despite its many deficiencies, Firefox remains the least bad and annoying of them all, which isn't saying much for the wider Web. But that's the state of play. Hopefully, this article has solved your problem. If Firefox 65 is slow closing down, consider the ESR version as the painkiller. And we're done.