I’ve been blogging quite a bit about the beta versions of Firefox 3, which can be downloaded here, and how much better it is than Firefox 2. If anything, I’m as excited about this version as I was when version 1 came out, as it feels like the browser I have been using for 5 years has now grown up and many of the issues it has had in the past have been ironed out.
In this entry, I am going to go through the various changes that have been made in Firefox which improve the performance of the browser – the startup times, the time it takes to render web pages, and the general responsiveness of the program. Improving performance has been a major focus of the Firefox developers for this release, and the changes are notable.
Do a search for ‘firefox bloated‘ and you’ll get over 500 000 results, many of which complaining that Firefox is big and slow. Many put this down to the amount of memory it uses, which, in Firefox 2, appears to be more than its main competitors – Opera, Internet Explorer and Safari. (Note that unless you’re using Windows Vista, it is difficult to measure memory usage of individual programs on Windows successfully)
For Firefox 3, reduces Firefox’s ‘memory footprint’ (the amount of memory it needs to run) was one of the main priorities. Improvements have been made both in reducing ‘memory leaks‘ – memory taken by Firefox that isn’t released back to the operating system when it is no longer needed – and memory fragmentation, which means that the memory it does have allocated is used more efficiently. The culmination of this is that, on Windows, Firefox 3 uses less memory while running than any other current web browser. It also released more memory back to the operating system after a period of inactivity, meaning that it’s no longer needed to close and restart the browser because it’s eaten half of your RAM.
How does this improve performance? If you have 16 GB of RAM, then, not much really. But if like most computers your machine has just enough RAM to perform, then it means more of Firefox can fit into RAM and less of it has to use ‘virtual memory’ – essentially a big file on your hard disk which acts as an overflow when all of your RAM is used up, but that is much slower than RAM. It will also allow more space for other programs in RAM, so you’ll be able to run more programs at the same time as your web browser.
Several parts of Firefox have been re-written to fix bugs and simplify code, and in some cases, improve performance. There have been performance improvements in:
- Page rendering – a marked performance increase that also means that Firefox 3 will pass the Acid2 test
- Image drawing – a bug fix sorted out problems with image caching and a new JPEG decoding routine also means that images will render faster
Firefox 3 finally moves away from the really old QuickDraw API to the newer Cocoa API. As well as giving nicer widgets (scrollbars, buttons etc) on web pages, this also means the whole program should feel more snappy. This, combined with the new theme, means that Firefox 3 is the most Mac-friendly version to date.
Profile guided optimisation
Firefox is now, essentially, compiled twice – the first compile runs as usual, and then the compiler runs a series of tests which optimises the code by looking at what parts of the browser will be most used in a working environment. This has lead to performance improvements of at least 10%.
Because we’re now approaching the ‘release candidate’ stage, ahead of a final release probably some time in June, most of the performance changes have now been made, so if you want to see if it is an improvement for you, now is as good a time as any to try; any further changes will be to fix any major bugs and stability issues. All in all, the massive strides made in performance make Firefox a much bigger competitor in the web browser arena and may win back some of its earlier detractors.