By the way, that's not to say Firefox can't use improvements in this area. For example, bug https://bugzilla.mozilla.org/show_bug.cgi?id=83305 has been an occasional issue for me for many years now -- with upstream's response being basically "blah, I can't be bothered to fix this". One of these days I'll be motivated to fix it myself, but my brief glances into the Firefox code always scare me...