I'm with the GP on this: FF is unstable with lots of tabs. It's a big memory hog, and it's been like this for about 2 years in my experience so far. I'm using a Mac with 16GB RAM, and it's not enough for Firefox any more (something changed, it used to use less memory). Using current FF (103.0b9). Lot of tabs, but auto tab-unloading so there shouldn't be a large number active.
Reported memory use (in Activity Monitor) varies, 8GB-25GB, and it's often swapping. Sometimes it uses more, and then the system crashes. Often it fills my remaining 20GB of free disk space for swap space. Surprisingly, even opening HN pages and only following HN links (i.e. all text-only), the memory usage grows in this way over time.
It's not possible to scroll smoothly or type a comment like this without pauses and occasional spinning beach balls. Just scrolling through a page with two-finger drag, it will stop every 10 seconds or so, then jump forwawrd. Moving the cursor with the cursor keys in this comment window is similar.
The constant jank and pauses may be entirely due to memory swapping or some other garbage-collection like overhead, I have no way to know.
What other people write about this issue is that it's likely some combination of number of tabs, and the fact that modern pages need a lot of memory for large images, compositing and similar, and perhaps memory used by add-ons. But all of this has suggestive evidence against it: If I go to about:memory and click "Minimize memory usage", it consistently brings memory usage down to not much more than when Firefox starts up, without appearing to change any functionality or deactivate any tabs; and when it starts up it's using less than 8GB despite loading up the same session. It also does this itself spontaneously from time to time, though not reliably enough.
That said, I switched from Safari when I realised Safari was also being a memory hog and was causing everything else on the laptop to be slow. At the time I switched, Firefox was a lovely breath of fresh air in that department. Even though I copied over all my tabs from Safari (by hand), Firefox ran in very much less RAM, and life was good again on the laptop.
Something has changed since then, making Firefox much worse for memory usage, and I don't yet know what it is.
I think this is due to specific sites. I try to avoid Google Docs and have a separate instance of Chrome only for that. I updated to the M1 Max with 64gb so even if FF slowed down at some point I wouldn't know at this point. But it was OK on my previous air which was pretty weak.
"about:performance" does not show any pages or add-ons being memory hogs. The memory use per page that it shows is surprisingly small, and the total comes to < 1GB.
And I see the real memory usage grown, eventually to crashing size, even when I'm just reading around HN, clicking many article headings and comments but remaining within the HN text-only site.
I agree it's probably made worse caused by specific sites, but I haven't been able to figure out which ones, or perhaps it's wide range of them, which defeats browsing in general. However, I now avoid Telegram Web, because that does consistently crash Firefox for me eventually (I've seen reported memory use grow to 67GB when TW was open, about three times).
Whatever it is, it doesn't look like site JavaScript holding data in large JavaScript objects or DOM trees, because minimizing memory use with "about:memory" reduces the size to workable levels without any other observable effect on open pages.
So I'm inclined to think of the Firefox as having a severe reclaimable-but-not-reclaimed memory leak or cache problem of some kind, that is outside the world of JavaScript data.
Oddly, I also use FF on a 16GB Mac and experience none of those slowdowns that you mention. On my work machine, FF typically has around 100 tabs grouped into 4-6 tab groups by project and it is solid.
I do find that some websites end up using 1GB+ of memory if you leave them running for an extended period of time (looking at you MacRumors forums) but that happens on Safari and Chrome, too. HN is usually the safest one that uses the least memory. Sites with lots of ads load all kinds of crap and can use surprising amounts of memory.
An anecdote about the jank and pauses: I have... many (D:) tabs open in Chrome right now, and I discovered that setting Session Buddy to show the number of tabs in its icon causes the entire browser to pause for a fraction of a second every 1-2 seconds. Clearly this is because Session Buddy is calling the "get list of open tabs" API method, which for all I know is using a global mutex that is held for as long as it takes the browser process to get and build the tab list. Perhaps something similar is happening in Firefox. Try doing the whole nuke-profile-from-orbit thing, remove all extensions, reset all the settings, etc (after backing the profile up sufficiently to be able to put it all back). It might be some obscure option or configuration flag. Given the low number of tabs it's not likely to be that.
I vaguely remember reading a discussion about how much memory Firefox should use to optimize performance. Some ppl wanted it to just use everything while others wanted a memory footprint as small as possible. I think they went with a percentage of available memory, an idea neither side liked. (hah)
Reported memory use (in Activity Monitor) varies, 8GB-25GB, and it's often swapping. Sometimes it uses more, and then the system crashes. Often it fills my remaining 20GB of free disk space for swap space. Surprisingly, even opening HN pages and only following HN links (i.e. all text-only), the memory usage grows in this way over time.
It's not possible to scroll smoothly or type a comment like this without pauses and occasional spinning beach balls. Just scrolling through a page with two-finger drag, it will stop every 10 seconds or so, then jump forwawrd. Moving the cursor with the cursor keys in this comment window is similar.
The constant jank and pauses may be entirely due to memory swapping or some other garbage-collection like overhead, I have no way to know.
What other people write about this issue is that it's likely some combination of number of tabs, and the fact that modern pages need a lot of memory for large images, compositing and similar, and perhaps memory used by add-ons. But all of this has suggestive evidence against it: If I go to about:memory and click "Minimize memory usage", it consistently brings memory usage down to not much more than when Firefox starts up, without appearing to change any functionality or deactivate any tabs; and when it starts up it's using less than 8GB despite loading up the same session. It also does this itself spontaneously from time to time, though not reliably enough.
That said, I switched from Safari when I realised Safari was also being a memory hog and was causing everything else on the laptop to be slow. At the time I switched, Firefox was a lovely breath of fresh air in that department. Even though I copied over all my tabs from Safari (by hand), Firefox ran in very much less RAM, and life was good again on the laptop.
Something has changed since then, making Firefox much worse for memory usage, and I don't yet know what it is.