Thursday, September 9, 2010

By not serving environment-optimized binaries, Mozilla is denying Firefox users an optimum experience (and hurting Firefox)


To summarize, I've observed that Mozilla's practice of distributing official binaries that aren't optimized to take advantage of new features and other improvements in modern CPUs (and possibly operating systems) results in a relatively inferior user-experience for Firefox users, ultimately hurting Firefox (and thus Mozilla).

More specifically, the binaries distributed by Mozilla use the Greatest Common Divisor (GCD)/Highest Common Factor (HCF) approach (this approach is mistakenly labeled Least Common Multiple (LCM) by many, many people) for compilation, resulting in binaries that don't make use of relatively newer instruction set extensions such as SSE, SSE2, etc. Additionally, the compilation settings used by Mozilla result in binaries that are optimized for size, at the expense of performance. The result is a non-insignificant deterioration in Firefox's performance (I've observed non-insignificant performance difference between non-optimized and optimized versions of Firefox on popular benchmark tests such as V8). This difference is visible to, and hurts those Firefox users whose systems allow Firefox to provide only slightly less than just-acceptable performance (such users would probably get slightly more than just-acceptable performance with optimized builds).

Mozilla's practice also denies better experience to those users who have faster connections (so they don't mind downloading a larger installer) and newer CPUs (so their systems are capable of performing better).

One of the computers I own and maintain is exactly such a system. Chrome runs smoothly, whereas the official version of Firefox 3.6.8 struggles, as if it's at a loss of breath. Switching to an optimized version of Firefox has improved performance noticeably, and has prevented me from switching full-time to Chrome on this system. What my own example shows is that there's a bunch of users whose machines don't provide them with a satisfactory Firefox experience because Mozilla doesn't optimize Firefox for performance. Is this number of such users large? Is it so large that a switch by these users from Firefox to the undeniably-snappier Chrome will materially hurt Firefox/Mozilla?

How can Mozilla solve this problem? The following options come to my mind:
  1. Fat installer, normal install: An installer will contain multiple versions of binaries, intended to cover the most-common types of systems in existence. During installation, the installer will perform system capability assessment, and those binaries will be installed which are best suited to the environment. This solution will most likely result in a decrease in the number of downloads, due to increased installer size.
  2. Normal installer, normal install: The installer will carry only the GCD/HCF code (thus keeping it small-enough for most people to download), but will perform system capability assessment during installation. If it determines that more optimized binaries can be run on this system, it'll either quietly pull those binaries from the Web, or will ask the user for his consent before pulling the more optimized files.
  3. Separate installer, normal install: Since only power users are expected to be bothered about using optimized binaries, Mozilla should make available official but optimized versions of Firefox on, albeit hidden from general users (so they don't accidentally download an installer which their system might not support). The installer, even for an official but optimized version, will perform system capability assessment to ensure that installation is being conducted on a supported system. This approach has the disadvantage that it serves only power users. It fails to provide the benefits of optimized Firefox to the masses.
  4. Regular installer, deferred optimization: Install the regular Firefox, and on first launch, it'll itself perform system capability assessment and ask your permission to optimize itself by downloading and installing optimized versions of files that are best-suited to the current system. Alternatively, it'll quietly download and install these files, and the effects will be visible after a restart.
  5. Thin installer, normal install: This is the approach that I favor the most. A tiny installer that doesn't carry any binaries will perform system capability assessment and submit the results to, which'll supply the installer with the files best-suited for the system. This type of installer - Chrome also uses a thin installer, although I'm unaware if it pulls system-specific binaries - appears to be suitable for both amateur and power users.
Related content: Swiftweasel; Swiftfox


  1. Update (20-Sep-10): Post installation and post every update, Firefox should defragment its core files. I've observed multiple times that post a version update, some of Firefox's core files get heavily fragmented. The resultant performance loss can be avoided if a small amount of defragmentation is performed on the core files.

  2. Update 2 (20-Sep-10): Pale Moon project appears to be closest to my wishes, although I'll love it if Mozilla provides "officially optimized" versions of Firefox, complete with features such as Software Update, etc.