Thursday, October 27, 2016

YouTube video stuttering in Firefox

This post concerns a relatively specific hardware and software setup.

I have a nine-year-old computer that has just 1 Gb of RAM (yes, one gigabyte), a one-core CPU and an integrated Intel video adapter. The operating system is Windows XP SP3.

In that computer, the default browser is Firefox because of its much lower memory footprint compared to other major browsers; and the version of Firefox is 39.0.3, as it's the last one with which Flash videos (off YouTube) are played back without stuttering much. That older version of Firefox also supports cookie prompts, which were removed in Firefox 44 or 45.

For that non-stutter to happen, I must set the process priority Above Normal for Firefox's plugin-container.exe program in Process Explorer (the latter is a fancy task manager; I usually have it on all the time).

So far, all this has worked nicely with Flash extended support releases (ESRs, currently at 18.x.x.x branch) up until version; I haven't tested with newer Flash versions yet.

Caveat: This setup didn't seem to work properly on a newer computer with the same OS and more RAM (wherein Flash stuttering in Firefox was much lesser, btw), apparently causing slowdowns with heavy CPU usage and other issues. I never quite found out what the exact cause was, but upping plugin-container priority might have been it.

IIRC, Linux seems to have that stuttering issue solved with Firefox and HTML5 video playback and a fresh profile. At least I don't remember any stuttering issues in Linux.
Strangely enough, resource usage scenarios are different between Windows and Flash vis-a-vis Linux an HTML5: In Linux, HTML5 video playback does not seem to consume a lot of resources on its own; whereas HTML5 video playback with the aforementioned Windows configuration is very resource-intensive, while Flash playback is reasonable in terms of CPU usage.
Other settings of note that decrease Firefox memory/CPU consumption:
(There's an older blogpost that I've considered updating. Might as well put all this into a completely new post to reflect the times, since many long years have passed in-between.)
In about:config

browser.sessionstore.interval is set to 600000. This interval changes the frequency of session saves.
browser.sessionhistory.max_entries (current browsing history per tab) is set to 25 instead of 50.
browser.sessionhistory.max_total_viewers is set to 0.
nglayout.initialpaint.delay is set to 0. The default non-zero value allows the Gecko layout engine to wait a while until a major part of a page is loaded. The setting of 0 can be more CPU-intensive, but I sometimes prefer seeing a complex page load early.
For very long and complex pages that might choke a graphical browser, there's Lynx.
Most of the plugins (not browser add-ons, but actual plugins) are switched off or set to Ask to Activate.

NoScript, Flashblock and Adblock Plus (ABP) are the must-have extensions for Firefox, without which normal web browsing would be impossible.

For many years, I didn't even use an adblocker, and entirely relied on NoScript and Flashblock, but video ads on YouTube had finally caused me to install ABP.
I recall this was gradual, and I used to use only Flashblock, but then having to use older Internet-connected computers (around 2010/2011 or even a couple years earlier), I finally resorted to using NoScript, too.
Since Firefox and SeaMonkey share the same rendering engine, these settings and add-ons apply to both.

On my currently-primary Firefox profile, I also keep the same session for many months, with lots of tabs that could instead be saved into bookmarks, but Firefox is set only to open the tabs that I select at startup.

The PlacesCleaner add-on can occasionally be used clean up the session database that's become a bit messy over all those months. In time, I'll transition to a new profile, so that I'd be able to do some work and stuff and keep the bookmarks. And it's likely, that with this Firefox profile, I won't be saving the session, and will use bookmarks instead for all the stuff I want to read later on.

No comments: