Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Use UPX to make Firefox load faster

  • Please log in to reply
5 replies to this topic
  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005
There are literally hundreds of tricks out there for speeding up Firefox. I know, I've tried many of them myself because the biggest complaint I have about Firefox is the almost intolerable startup time. For my 3Ghz P4 with 1GB ram, the program takes more than 12 seconds to load if the program has never run before. In computer time, 12 seconds is a lifetime!

About a year ago, Ian "Gizmo" Richards published a tip about using UPX to compress Firefox and thereby speeding up the startup time. Of course I tried it and lo and behold (I always wanted to say "lo and behold") it worked! Startup time was cut almost in half. Although I understand (for the most part) how compression speeds up start time, I'm certainly don't understand why it speeds it up as much as it does. Startup time is still is not as fast as IE but it is much more tolerable.

Here's my version of the tip (customized for AHK dudes and dudettes)...

Step 1
If you don't have UPX, you can download a copy from http://upx.sourceforge.net/. Put a copy of the upx.exe file somewhere in the path. If you're not sure where to put it, the "C:\Windows" folder is a good spot. If you have AutoHotkey installed, you can also find a copy of upx.exe in the "Compiler" sub-folder. For most installations, it is located here: "C:\Program Files\AutoHotkey\Compiler"

Step 2
Create batch files to compress and decompress Firefox.

Here's my version of the batch file to compress Firefox (Name it Firefox_Compress.bat):
pushd "%ProgramFiles%\Mozilla Firefox"
for %%v in (*.exe *.dll components\*.dll plugins\*.dll) do upx "%ProgramFiles%\Mozilla Firefox\%%v"

This batch file will compress all exe's and dll's in the components, plugins, and the root Firefox folder.

Here's my version of the batch file to decompress Firefox (Name it Firefox_Deompress.bat):
pushd "%ProgramFiles%\Mozilla Firefox"
for %%v in (*.exe *.dll components\*.dll plugins\*.dll) do upx -d "%ProgramFiles%\Mozilla Firefox\%%v"
These batch files have only been tested on Windows XP. You might need to make minor modifications for older versions of Windows.

Step 3
To compress Firefox, run Firefox_Compress.bat. Please note that not all exe's and dll's in the Mozilla folder can be compressed. You may get messages warning you of this. Don't worry, this is normal.

To decompress Firefox, run Firefox_Decompress.bat.

Be sure to close Firefox before running either of these batch files.

Warning: These batch files will modify files on your computer. Please use with care and at your own risk.

Final Thoughts
Of course, everthing comes with a cost. You will need to decompress Firefox in order to perform an update. If you get a message telling you that an update has been downloaded, stop Firefox, decompress, and then restart Firefox. You might need to force the update to be re-downloaded. After the update has been applied, don't forget to stop Firefox and re-compress.

If you're interested, here's a link to original Ian "Gizmo" Richards tip:
http://www.techsuppo... ... faster.htm

Good night and good luck!

  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Great tip! Thanks for the easy-to-follow instructions.

  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
This did speed up my Firefox by a few seconds, great :)

However I found that compressing all files blocks sessions and cookies, even in safe mode or for a newly installed copy. Perhaps there is a certain file that controls this and needs to be left uncompressed (secury maybe)? If this is true please let me know so I can amend the compression batch file. Thanks.

autohotkey.com/net Site Manager


Contact me by email (polyethene at autohotkey.net) or message tidbit

  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005
OK, I'll bite. I'm not too smart sometimes...

compressing all files blocks sessions and cookies...

Do you mean session cookies? I had to look this one up. According to one source, a session cookie is a "Temporary cookie stored in a computers memory for remembering preferences during a web site visit that is flushed on leaving the site."

Personally, I install all kinds of software/updates to block ads and malicious sites, so running into a site that complains about my setup does occur on occasion. But other than that, I have no problem using the compressed version of Firefox for secure and general-purpose browsing.

I definitely use cookies so I select the "Allow sites to set Cookies" option but I also set the "Keep Cookies until I close Firefox" option to automatically delete the billions of extraneous cookies that are created during a typical browsing session. For cookies that I want to keep permanently, like cookies for Autohotkey.com, I add the web site to the "Exceptions" list with the status of "Allow". These options may affect session cookies.

I noticed that the new version of UPX (version 2.01) appears to compress more of the files in the Firefox folders. You might want to try the new version of UPX, if you haven't already, to see if it makes a difference.

If all else fails, post a couple of the sites where you're having a problem. At least we'll be able to duplicate the problem and maybe someone out there can help to identify which exe or dll (if any) should be excluded from the compression list.

Them be my thoughts...

  • Members
  • 1029 posts
  • Last active:
  • Joined: 01 Oct 2005
Minor update... I just downloaded and installed the latest version of Firefox: v2.00.01. From a compression POV, big mistake. For some reason, most of the modules are not compressible, at least not by UPX. I tried UPX v2.01 and v2.03 without any luck. I haven't tried any of the older versions of UPX.

I did a quick downgrade to Firefox v2.0 and I'm good to go. Obviously this is a short-term solution but it will keep me going for a little while. You can download older versions of Firefox from here: http://releases.mozi... ... /releases/

If I find anything, I'll post it. If anyone knows the whos or whats of this issue, please post!

Them be my thoughts...

  • Members
  • 251 posts
  • Last active: Dec 19 2012 03:54 PM
  • Joined: 04 Oct 2006
Also, consider how your extensions might be effecting your startup time. I investigated why on my fastest machine FireFox startup was about 3 times as long as on a much slower one.

Turns out Delicious (put the appropriate punctuation in there as you see fit) was adding about 10 seconds to my startup time... it had to go.