Technology news and Jobs arrow VIRTUALISATION arrow Make Firefox fly: building from a minefield of source
Make Firefox fly: building from a minefield of source E-mail
by David M Williams   
Monday, 30 June 2008
The new, record breaking, Firefox 3 web browser is the fastest version of Firefox yet. But are you really getting the biggest bang for your buck (metaphorically speaking, because, of course, Firefox is free?) You can eke out a better disk and memory footprint and higher speeds by building it yourself from the original source code. I'll show you how, with genuine metrics to prove it.



I'll start with some info on my system: I'm using a Dell Inspiron 6400 laptop, also known as a Dell e1505. It has a Core 2 duo T5600 processor running at 1.83GHz and a mere 1Gb of RAM. This is, I'd expect, a fairly average mid-range laptop and is thus representative of a wide sample of laptops.

It's running Fedora release 9 (Sulphur), with Linux Kernel 2.6.25.6-55.fc9.i686 and GNOME 2.22.2 as advised by System/About this Computer. Firefox's Help/About menu reports it is Firefox version 3.0, specifically Gecko/2008061712 Fedora/3.0-1.fc9. I've run System/Administration/Update System to check I've got the latest version of Firefox available from the Fedora software repositories.

Let's check how large Firefox is on disk. To do this, we first have to find where it is. We use the which command for this which locates where a specified program is within the directories listed in the PATH environment variable.

[david@dmw ~]$ which firefox
/usr/bin/firefox


So, on this laptop, when I call the Firefox web browser, it's the program /usr/bin/firefox which is being invoked. This program file, however, is not a compiled binary file but is instead a shell script. You can tell this by a variety of methods, not least that the file size is quite minute for a complex piece of software:

[david@dmw ~]$ ls -s /usr/bin/firefox
8 /usr/bin/firefox


Compare this to the zip compression utility which also lives in /usr/bin:

[david@dmw ~]$ ls -s /usr/bin/zip
84 /usr/bin/zip


The zip program is 10 and a half times as large for a much smaller set of functions and requirements. Thus the firefox program in /usr/bin is either a shell script or it makes heavy use of ancillary files to break up its function. The former is the case as can be seen by opening it in a text editor like so:

[david@dmw ~]$ view /usr/bin/firefox

or, if you prefer something more graphical

[david@dmw ~]$ gedit /usr/bin/firefox

Either way, you can see the shell script instructions; according to comments by the author, the script sets up the environment "voodoo" to make Firefox work.

This begins by determining the processor type using the uname -m command. On my Dell laptop that gives i686. For 64-bit architectures - with results like x86_64 or ia64 - an environment variable MOZ_LIB_DIR is set to directory /usr/lib64. For anything else, which includes processors like mine, the MOZ_LIB_DIR variable is set to directory /usr/lib.

Scrolling down a bit you will then see the script then works out where your executable firefox program is as well as all the plugins and configuration items based on the directory $MOZ_LIB_DIR/firefox-3.0 - that is, from either /usr/lib/firefox-3.0 or /usr/lib64/firefox-3.0 depending on your processor.

Please read on to see the size of the genuine Firefox 3.0 binary as well as how to get the source code and build it yourself, for your very own hardware.

CONTINUED



 
< Next story in category   Previous story in the category >
iTWire user statistics Visitors last 30 days
694,279
Subscribers 15,210
#1 independent technology news advertise here
  •   *  
  • Search
  • AdvSeach
  • Login
  • Events
  • FreeStuff

- Advertisement -

Featured Whitepapers

Follow iTWire on Twitter

About iTWire

iTWire is all about technology news, information, jobs and community for the IT and telecommunications industry professional. Subscribe to our free ICT daily newsletter