Speeding up Firefox to the maximum

ekrem

Silver Member
Aug 9, 2005
7,973
587
93
1st Step

Go into your Firefox Profile on HDD and create a file "user.js".
This file doesn't ship in standard with Firefox, but once you create it all content within that file will overwrite your "about:config"-settings.
When you enter "about:config" in your Browser-Bar you can enter different values, but Firefox will prioritize the settings in the user.js file you created.

You save "user.js" to somewhere like /home/ekrem/.mozilla/firefox/YOUR-PROFILE/

user_pref("network.prefetch-next", false);
user_pref("browser.cache.disk.enable", true);
user_pref("browser.cache.disk.capacity", 131072);
user_pref("browser.cache.memory.capacity", 20000);
user_pref("browser.safebrowsing.enabled", false);
user_pref("browser.safebrowsing.malware.enabled", false);
user_pref("content.notify.backoffcount", 5);
user_pref("content.interrupt.parsing", true);
user_pref("content.max.tokenizing.time", 2250000);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("nglayout.initialpaint.delay", 0);
user_pref("network.http.pipelining", true);
user_pref("network.http.proxy.pipelining", true);
user_pref("network.http.pipelining.ssl", true);
user_pref("network.http.pipelining.firstrequests", true);
user_pref("network.http.pipelining.maxrequests", 8);
user_pref("network.http.max-connections", 48);
user_pref("network.http.max-connections-per-server", 24);
user_pref("network.http.max-persistent-connections-per-proxy", 16);
user_pref("network.http.max-persistent-connections-per-server", 8);
user_pref("browser.sessionhistory.max_entries", 20);
user_pref("browser.sessionhistory.max_total_viewers", 1);
user_pref("browser.sessionstore.max_tabs_undo", 4);
user_pref("browser.sessionstore.interval", 50000);
user_pref("mousewheel.withnokey.sysnumlines", false);
user_pref("mousewheel.withnokey.numlines", 10);
user_pref("geo.enabled", false);
user_pref("browser.tabs.animate", false);


2nd Step
Create this folder structure somewhere you choose on your HDD

Fore example:

/important/firefox-data/firefox-cron-backup/

/important/firefox-data/firefox-secure-backup/

/important/firefox-data/scripts/




3rd Step
Backup your complete Firefox-Profile folder to /important/firefox-data/firefox-secure-backup/



4th Step
Now you create 2 files in /important/firefox-data/scripts/ with this data. Be SURE TO MODIFY THE FILEPATHS WHERE YOUR STANDARD FIREFOX-PROFILE LIES.

1st file == "login-firefox.sh"
#!/bin/bash
# At Login your Firefox-Profile will be based in RAM.
# Your Firefox-Profile will be therefore empty as you can not keep DATA in RAM when you Boot.
# So we have to copy our Cron-Backup into RAM once you reboot your system


## Deletes your whole Standard Firefox-Profile
rmdir /home/ekrem/.mozilla/firefox/uq3g6doz.default/*
rm --interactive[=never] -r /home/ekrem/.mozilla/firefox/uq3g6doz.default/*


## Copies your Cron-Backup from HDD into your Standard Firefox-Profile which relies in RAM
cp -r /important/firefox-data/firefox-cron-backup/* /home/ekrem/.mozilla/firefox/uq3g6doz.default


2nd file == "logout-firefox.sh"
#!/bin/bash
#
# When you logout from your System we'll backup your Firefox-Profile, which relies in RAM to the HDD
# If we don't do this your whole Firefox-Data would be lost


## First we delete the Firefox-Cache. My Cache is usually +400 MB.
## We don't have to copy this crap data
rmdir /home/ekrem/.mozilla/firefox/uq3g6doz.default/Cache/*
rm --interactive[=never] -r /home/ekrem/.mozilla/firefox/uq3g6doz.default/Cache/*


## We delete our old Cron-Backup folder from HDD, as we will renew this folder with the data from RAM
rmdir /important/firefox-data/firefox-cron-backup/*
rm --interactive[=never] -r /important/firefox-data/firefox-cron-backup/*


## We know vacuum all SQLite Database in your Firefox-Profile
## Be sure that you have SQLite installed in your system
for f in /home/ekrem/.mozilla/firefox/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done


## Everything done. Know we copy the RAM-Data to HDD.
## At next system boot you'll have this data again in RAM from "login-firefox.sh" script
cp -r /home/ekrem/.mozilla/firefox/uq3g6doz.default/* /important/firefox-data/firefox-cron-backup


Now make both files executable.
Either with chmod from console or right-clicking each 2 Files and selecting the executable option.


5th Step
Dependend on your system you'll have somwhere in System-Settings an option to add Programs/Scripts to Boot and Logout process.
The location of the Systemsetting differs (KDE/GNOME/XFCE).
Once you located this Systementry, you add to the boot-process the created "login-firefox.sh" which is in /important/firefox-data/scripts/.
To the shutdown-process you add "logout-firefox.sh".

If you use KDE you can simply open a console and type:
cp /important/firefox-data/scripts/login-firefox.sh /home/ekrem/.kde4/Autostart

cp /important/firefox-data/scripts/logout-firefox.sh /home/ekrem/.kde4/shutdown

6th Step
Now we'll create a TMPFS (RAM) partition which will be mounted the next time you reboot.
This partition points to your Firefox-Profile.

As Root, open this file either with your Text-Editor or go into console and type
nano /etc/fstab
This file contains the mount-partitions of your System.
At the bottom add a new line with this data.
BE SURE TO MODIFY THE PATH TO YOUR STANDARD FIREFOX-PROFILE:
tmpfs_firefox /home/ekrem/.mozilla/firefox/uq3g6doz.default tmpfs noatime,nodiratime,mode=1777 0 0

At next Boot, your RAM-partition will be created and your Firefox will be in Ram

7th Step
This step is optional.
If you have an instable system which crashes a lot (it shouldn't) you can add
another Backup-Process independent from System-Login/-Shutdown.
So far we just make operations at boot and shutdown.

As root open a console and type:
nano /etc/crontab

At the bottom of this file add these new lines:
# In addition to backing up your RAM Firefox-Profile-Data at shutdown-event,
# also backup your data in live-system.
#
# SAVE Ram-Data to HDD every 2 hours
0 */2 * * * root ./important/firefox-data/scripts/logout-firefox.sh
 
If you wanto to go a step further, install this extension:
https://addons.mozilla.org/de/firefox/addon/local-load/?src=userprofile

It is over 4 MB and it contains all Javascript libraries, which are used in today's Internet-World. Normaly you download these Libraries as you browse.
After you've installed this extension, Firefox will load the Javascript-Libraries from your RAM ( your whole Firefox lies there now) instead of downloading them from Internet.
 
I you have lots of RAM you can rewrite this script to other Aplications.
I have 16 GB RAM and my RSS reader, personal Organizer etc. all are in RAM.

You can also add the system's logging-features to RAM to avoid HDD activity as much as possible:

nano /etc/fstab

tmpfs_/tmp /tmp tmpfs noatime,nodiratime,mode=1777 0 0

tmpfs_/var/tmp /var/tmp tmpfs noatime,nodiratime,mode=1777 0 0

tmpfs_/var/lock /var/lock tmpfs noatime,nodiratime,mode=1775,size=20m 0 0

tmpfs_/var/log /var/log tmpfs noatime,nodiratime,mode=1755,size=80M 0 0

tmpfs_/var/run /var/run tmpfs noatime,nodiratime,mode=1755,size=20M 0 0

tmpfs_/var/spool /var/spool tmpfs noatime,nodiratime,mode=1750,size=20M 0 0
 
Just use Google Chrome and you won't have to worry about all that.

You can put Google-Chrome into RAM by same approach. Just little modification of the script.

If you're adventurous you can try these steps with the step-by-step instruction above. You won't regret it. Whole applications will become responsive. Your surfing experience will only be limited by your internet-connection and the performance of Server you're requesting data from.
 
I see you speak advanced Geekanese. I'm still working at the beginner level.

I have a new computer and I switched my distribution to Sabayon Linux.
It is based on Gentoo's testing-branch, and fully compatible with Gentoo.
The only real difference between both distribution is, that Sabayon both offers Gentoo's "package manager" and a package-manager which Sabayon has developed where you can download pre-compiled packages from their Servers (like it is handled in Debian, Ubuntu or Mint).

Sabayon | Home
Gentoo's testing branch is about on par with Debian's Sid (unstable branch) releases. Though based on the bleeding edge, you will find Sabayon is quite stable and perhaps more cutting edge. Both Sabayon and Gentoo are on rolling release cycle, but Sabayon will have release snapshots.
Sabayon when using the package manager Entropy is binary based. (currently Sabayon has about 10,000 packages in Entropy)
Sabayon when using the package manager Portage is source based. (the Gentoo repo is quite huge)


For smaller Applications I use Gentoo (portage), where all Applications will be compiled from source uniquely optimized for my CPU.
There's better performance by this approach.

https://wiki.sabayon.org/index.php?title=FAQ#Why_choose_Sabayon_Linux_.3F
undoubtedly a program will eventually have a feature you don't need, and will just take up space or slow down the program. In a binary distro, you're stuck with this feature. In a source-based distro you have the option of removing unwanted features at the time of compilation

If you install PHP with apt-get on Debian it will have both the very old mysql_* and the newer improved mysqli_* functions.
You don't need the old, so you don't need to have them compiled into PHP by Debian. But Debian does, because they've compiled it that way.

But for very big Applications like LibreOffice I use Sabayon's binary packages, because some applications like LibreOffice take huge time to install from source.

Hoepfully, never computer freeze again :)
 
I see you speak advanced Geekanese. I'm still working at the beginner level.

I have a new computer and I switched my distribution to Sabayon Linux.
It is based on Gentoo's testing-branch, and fully compatible with Gentoo.
The only real difference between both distribution is, that Sabayon both offers Gentoo's "package manager" and a package-manager which Sabayon has developed where you can download pre-compiled packages from their Servers (like it is handled in Debian, Ubuntu or Mint).

Sabayon | Home
Gentoo's testing branch is about on par with Debian's Sid (unstable branch) releases. Though based on the bleeding edge, you will find Sabayon is quite stable and perhaps more cutting edge. Both Sabayon and Gentoo are on rolling release cycle, but Sabayon will have release snapshots.
Sabayon when using the package manager Entropy is binary based. (currently Sabayon has about 10,000 packages in Entropy)
Sabayon when using the package manager Portage is source based. (the Gentoo repo is quite huge)


For smaller Applications I use Gentoo (portage), where all Applications will be compiled from source uniquely optimized for my CPU.
There's better performance by this approach.

https://wiki.sabayon.org/index.php?title=FAQ#Why_choose_Sabayon_Linux_.3F
undoubtedly a program will eventually have a feature you don't need, and will just take up space or slow down the program. In a binary distro, you're stuck with this feature. In a source-based distro you have the option of removing unwanted features at the time of compilation

If you install PHP with apt-get on Debian it will have both the very old mysql_* and the newer improved mysqli_* functions.
You don't need the old, so you don't need to have them compiled into PHP by Debian. But Debian does, because they've compiled it that way.

But for very big Applications like LibreOffice I use Sabayon's binary packages, because some applications like LibreOffice take huge time to install from source.

Hoepfully, never computer freeze again :)

Okay, here's what I read:

I have a new computer and I switched my distribution to Sabayon Linux.
It is based on Gentoo's testing-branch, and fully compatible with Gentoo.
The only real difference between both distribution is, that Sabayon both offers Gentoo's "package manager" and a package-manager which Sabayon has developed where you can download pre-compiled packages from their Servers (like it is handled in Debian, Ubuntu or Mint).

Good so far
Now:

For smaller Applications I use Gentoo (なぜですか?), where all Applications will be compiled from source uniquely optimized for my CPU.
There's better performance by this approach.

Finally:

If you install ない? with apt-get on Debian it will have both the very old はい? and the newer improved はい? functions.
You don't need the old, so you don't need to have them compiled into どこ? by Debian. But Debian does, because they've compiled it that way.

:dunno:
 
The charachters you quoted, I can't read also.
My original post I can read.

Usmb.com has in the Meta-Head the West-European character-set.
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

It should be UTF-8 to support a wider user-language base.
It's the standard from CNN in America to China-Daily in China.

UTF-8 - Wikipedia, the free encyclopedia
UTF-8 and UTF-16 are the standard encodings for Unicode text in HTML documents, with UTF-8 as the preferred and most used encoding.
 
The charachters you quoted, I can't read also.
My original post I can read.


Usmb.com has in the Meta-Head the West-European character-set.
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

It should be UTF-8 to support a wider user-language base.
It's the standard from CNN in America to China-Daily in China.

UTF-8 - Wikipedia, the free encyclopedia
UTF-8 and UTF-16 are the standard encodings for Unicode text in HTML documents, with UTF-8 as the preferred and most used encoding.

The charachters you quoted, I can't read also.
My original post I can read.

:eusa_whistle:
 
ser_pref("network.http.max-connections-per-server", 24);
user_pref("network.http.max-persistent-connections-per-proxy", 16);

Depends on the sites you visit. Mine are set at 50....no problem
 

Forum List

Back
Top