Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

[TIP] Firefox and tmpfs: a surprising improvement

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
88 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
Author
Message
truc
Advocate
Advocate
User avatar
Posts: 3199
Joined: Mon Jul 25, 2005 9:24 am

  • Quote

Post by truc » Thu Jun 25, 2009 10:00 am

and what if your computer hangs? you're losing, among other things, the history since the previous backup?
The End of the Internet!
Top
El_Goretto
Moderator
Moderator
User avatar
Posts: 3198
Joined: Sat May 29, 2004 1:49 pm
Location: Paris

  • Quote

Post by El_Goretto » Thu Jun 25, 2009 10:09 am

truc wrote:and what if your computer hangs? you're losing, among other things, the history since the previous backup?
It is true with the local.stop method too isn't it?
If the computer is faily unstable I assume that both wrapper and crontab should be used... (but why using an unstable computer and trying to make it faster rather than fixing it first?) Otherwise wrapper should be enough IMHO.
-TrueNAS & jails: µ-serv Gen8 E3-1260L, 16Go ECC + µ-serv N40L, 10Go ECC
-Réseau: APU2C4 (OpenWRT) + GS726Tv3 + 2x GS108Tv2 + Archer C5v1 (OpenWRT)
Top
truc
Advocate
Advocate
User avatar
Posts: 3199
Joined: Mon Jul 25, 2005 9:24 am

  • Quote

Post by truc » Thu Jun 25, 2009 10:45 am

well, I may have misunderstood you a little, I thought this thread was about calling the script through a cronjob, and that's all. I didn't know about the local.{start,stop} method.

Anyway, I'm personnally calling the, let's say, firefox-tmpfs script, first in ~/.xinitrc, then in a cronjob, and with a wrapper (kind of alias ff="firefox; firefox-tmpfs")
The End of the Internet!
Top
Compintuit
n00b
n00b
Posts: 22
Joined: Wed Mar 11, 2009 9:05 pm

  • Quote

Post by Compintuit » Thu Jul 02, 2009 3:14 am

So... If I do this, having a 44MB places.sqlite file will no longer make searching my history take about 10 secs? Would we now be talking milliseconds? Because that would be nice... but I'm still a gentoo noob, so I think I'll have to wait a bit before I try. But this has definitely worked well for some people?
Top
Evincar
Apprentice
Apprentice
Posts: 217
Joined: Tue Feb 13, 2007 1:24 pm
Location: Madrid

  • Quote

Post by Evincar » Thu Jul 02, 2009 7:19 am

Compintuit wrote:So... If I do this, having a 44MB places.sqlite file will no longer make searching my history take about 10 secs? Would we now be talking milliseconds? Because that would be nice... but I'm still a gentoo noob, so I think I'll have to wait a bit before I try. But this has definitely worked well for some people?
It works, indeed, and the difference here is abysmal. From 3-4 seconds chokes to near instantaneous seeking.
<@Chin^> My sister caught me jacking off the other week and calls me a pervert
<@Chin^> just the other day i walked into my room and caught my sister masturbating
<@Chin^> So she calls me a pervert again?!?
<@Chin^> there is no justice in the world...
Top
loudmax
n00b
n00b
User avatar
Posts: 7
Joined: Wed Mar 30, 2005 5:52 am

QPFox on Github

  • Quote

Post by loudmax » Wed Sep 02, 2009 9:01 pm

I started a Github project based on stevenrobertson's script. The most significant changes I added are compression, sqlite vacuuming, and printing a nice usage message. It's available here: http://github.com/nickaubert/QPFox/tree/master
Top
Bircoph
Retired Dev
Retired Dev
User avatar
Posts: 261
Joined: Fri Jun 27, 2008 3:32 am
Location: Moscow

  • Quote

Post by Bircoph » Wed Sep 23, 2009 4:47 pm

I don't see great benefit from this on my system.
I moved .firefox to /dev/shm and first startup time dropped from ~2.5 secs to 2.0 secs, repeated startups doesn't differ at all. Anyway, this is filesystem's job to cache I/O and ext4 does this in a nice way.
Per aspera ad astra!
Top
Bill Cosby
Guru
Guru
User avatar
Posts: 430
Joined: Sat Jan 22, 2005 9:24 am
Location: Aachen, Germany

  • Quote

Post by Bill Cosby » Thu Sep 24, 2009 8:47 am

Agreed, with ext4 I hardly notice any improvement.
The Creature from Jekyll Island.
Top
krinpaus
n00b
n00b
Posts: 18
Joined: Wed Sep 01, 2004 11:25 pm

  • Quote

Post by krinpaus » Thu Sep 24, 2009 8:09 pm

Bircoph wrote:I don't see great benefit from this on my system.
I moved .firefox to /dev/shm and first startup time dropped from ~2.5 secs to 2.0 secs, repeated startups doesn't differ at all. Anyway, this is filesystem's job to cache I/O and ext4 does this in a nice way.
I too, tried this "solution", among MANY other combos, to try and improve firefox performance,
especially once updating to FF 3.5.x, with no meaningful result. (I've been running reiserfs
for years on most partitions except /boot and my media collection (xfs), and that combo
has suited me and all the systems I touch fine (except Oracle DB's those aren't on Gentoo, sadly)).

Employing NoScript and Adblock and Flashblock only helped slightly, Flashblock moreso.
. It's when I bit the bullet (lose all those cookies, etc...) and moved .mozilla to .mozilla-old
and restarted that performance improved. Evidently too much carry-over "crud" from previous versions,
including my customized settings, weren't (rightfully) in FF's best performance "interest".

I reimported my bookmarks and went back to setting up my unique logins for each site, and
all is well, I am much more satisfied (with Flashblock/NoScript/Adblock, performance or not...).
Top
waterloo2005
Apprentice
Apprentice
Posts: 271
Joined: Tue Aug 26, 2008 12:58 pm

  • Quote

Post by waterloo2005 » Wed Oct 27, 2010 11:29 am

firefox /home/steven/.mozilla/firefox/abcd1234.default tmpfs size=128M,noauto,user,exec,uid=1000,gid=100 0 0

here uid gid is about steven ?

I want to run .pack_ffox.sh when I reboot and shutdown computer .
How to do it ?

Do i need to use ordinary user to run .pack_ffox.sh ?

I know there is /etc/conf.d/local.stop , but all commands in it run as root .
How to run as ordinary user in /etc/conf.d/local.stop ?
thanks
i5-2450M, gnome, amd64
R,Mathematica,Emacs
Top
pierro78
n00b
n00b
Posts: 15
Joined: Mon Oct 08, 2007 8:37 am
Contact:
Contact pierro78
Website

Re: [TIP] Firefox and tmpfs: a surprising improvement

  • Quote

Post by pierro78 » Sun Nov 21, 2010 8:37 pm

stevenrobertson wrote: set browser.safebrowsing.enabled to false
set browser.safebrowsing.malware.enabled to false
Wow I've used the 2 above settings + browser.cache.disk.enable set to false on my gentoo install on a slow (2MB/s write) sdhc card (using ext4 without journal) and I can already see a big speed improvement ! much less annoying slowdowns ... thanks for the tip !

PS :
found some more tweaks to test on my slow SDHC card gentoo install :
- toolkit.storage.synchronous set to 0 ( http://www.roytanck.com/2009/04/05/more ... ed-tweaks/ )
- browser.sessionstore.max_tabs_undo and browser.sessionstore.max_windows_undo to 0 (found on http://startupmeme.com/the-coolest-fire ... ig-tricks/ )
- using the SQLite Manager, under the DB Settings tab, change the "temporary data store" setting to "memory" ( http://forums.mozillazine.org/viewtopic ... 7&t=696145 )
- history set to max 21 days

PS2 :
eventually, even after I applied all the above tweaks, I ended using the initial tip of this thread because I still had slowdowns due to the slowness of my SDHC card. My firefox profile is about 25MB so a 64MB tmpfs is more than enough (that's a compressed tar of less than 7MB). Now my firefox is very fast and smooth :) ... thanks again for the tip !
gentoo on :
SDHC card (panasonic R4) with a fast firefox
512MB IBM Thinkpad X40
HP 2510p
PC with FOXCONN G9657MA-8KS2H MB & Intel Q6600 CPU
Top
tclover
Guru
Guru
Posts: 516
Joined: Sun Apr 10, 2011 11:41 pm

YET another script! but this one do all necessaries...

  • Quote

Post by tclover » Sun May 08, 2011 9:04 pm

This a simple script to take care of everything.
#!/bin/sh
#~/.ffp-pack.sh
PF=""
FFH="${HOME}/.mozilla/firefox"
die() {
echo "$1"
exit 1
}
cd "${FFH}"
[ -n ${PF} ] || PF=`basename ${FFH}/*.default`
[ -z ${PF} ] && die "profile is empty."
[ -z "`mount|grep -F ${FFH}/${PF}`" ] && { sudo mount ff-p-`id -u` ${FFH}/${PF} -t tmpfs -o user,exec,uid=`id -u`,gid=`id -g`,size=128M || \
die "failed to mount ff-p-`id -u` tmpfs."; }
[ -f "${PF}/.unpacked" ] && {
tar --exclude $PF/.unpacked -cpf $PF.tmp.tbz2 $PF || die "failed to pack the profie."
mv $PF.tbz2 $PF.old.tbz2 || die "failed to override .old profile."
mv $PF.tmp.tbz2 $PF.tbz2 || die "failed to move the profile."
} || { tar xpf $PF.tbz2 && touch $PF/.unpacked || die "failed to unpack the profile."; }
If no profile is set, the script will take care of it, mount the tmpfs and unpack the profile. Of course you'll had to manually rm your profile... The tmpfs will just be mounted over your original profile dir. There's no need for whatever fstab line. Just add the script in bashrc or in the autostart applications, so you can start browsing after loggin.
EDIT: YOU HAVE TO MANUALLY ARCHIVE YOUR PROFILE THE FIRST TIME [and rm it, because you won't need it anymore].
Top
patrix_neo
Guru
Guru
User avatar
Posts: 520
Joined: Thu Jan 08, 2004 1:59 pm
Location: The Maldives

Re: [TIP] Firefox and tmpfs: a surprising improvement

  • Quote

Post by patrix_neo » Tue May 10, 2011 4:32 pm

pierro78 wrote:
stevenrobertson wrote: set browser.safebrowsing.enabled to false
set browser.safebrowsing.malware.enabled to false
Wow I've used the 2 above settings + browser.cache.disk.enable set to false on my gentoo install on a slow (2MB/s write) sdhc card (using ext4 without journal) and I can already see a big speed improvement ! much less annoying slowdowns ... thanks for the tip !
I am from a world of security-first. So I am just asking - Is this good practice? I am just curious how this will affect my browsing if I do this.
Top
Post Reply

88 posts
  • Previous
  • 1
  • 2
  • 3
  • 4

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic