Mac Firefox versions 3.0 through 3.5.1 suffer from abnormal CPU usage.
My MacBook Pro has 4GB DDR3 @1067MHz and a 2.66GHz Intel Core 2 Duo CPU. It is running Mac OS X 10.5.7.
Firefox can be seen using 97% of CPU0 while essentially idle. This is most noticeable when 3 or more tabs are open. The content of said tabs need not be anything other than static HTML. This is not an issue resulting from extensions/addons or Flash.
Interestingly the CPU usage can be reduced by increasing the disk cache. The default cache of 64M should be more than enough for a web browser, so there must be something else behind this, but I've found increasing the cache to 512M reduces CPU usage to about 50% CPU. This is still too much for an inactive application. Enter: Intel Architecture Optimization.
I've essentially compiled a very specific build of Firefox 3.5.1. For Windows machines, this is mostly irrelevant, as they all run on the X86 architecture, however a Mac can have a G3, G4, G5 or Intel CPU, and the differences can be vast.
I have used optimizations and tweaks in order to make this as fast as possible, thus it should only work on a Core2 based Mac running OS X 10.5 or newer. With this build, my CPU usage has dropped to 4.7% while idle.
Note: The application is named "Shiretoko" as the official "Firefox" name is reserved for official builds.
Do It Yourself!
The Mozilla developers provide an excellent explanation of how to build a generic version of Firefox here: https://developer.mozilla.org/en/Mac_OS_X_Build_Prerequisites. Of course, we're not looking to make a generic build, so after experimenting a bit I've found what I believe to be an optimized build using the following as a .mozconfig:
mk_add_options MOZ_MAKE_FLAGS="-s -j4"
ac_add_options --enable-optimize="-O3 -march=core2 -pipe -D_FORTIFY_SOURCE=2"
Fix the User Agent
After you download and launch the binary, you'll probably want to change the default User Agent as some web applicaitons (hello, Facebook Chat) are improperly coded to disable functionality based on reported User Agents. Here's what you do:
- Type "about:config" (minus the quotes) in your address bar
- Enter "useragent" (minus the quotes) as a filter
- Double click general.useragent.extra.firefox and change the value to "Firefox/3.5.1" (minus the quotes)
And there you have it!
Chris Latko (http://www.latko.org/downloads/) makes an exclusively Intel optimized build of Firefox. He publishes his optimizations in his mozconfig file and they are very similar to mine.
Adam Michael (http://firefoxmac.furbism.com/) makes builds for G3, G4 7400, G4 7450, and G5 machines. As my Macbook has an Intel CPU, I haven't tested these builds, but they seem promising.
I haven't edited any of the source code. You may download the source directly from Mozilla and build this yourself if you are security conscious.