Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Optimizing Firefox
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Fri Jun 08, 2012 9:15 pm    Post subject: Optimizing Firefox Reply with quote

Greetings.

I've seen that there are a bunch of optimized Windows Firefox builds in the wild, some of which claim to offer enormous performance improvements.
(source) Mashed_up's comments indicate that there are a bunch of patches.

And indeed, looking at pcxfirefox, bullet points such as
"Multithread load depending on tmemutil module (OpenMP)" or
"Improve some math functions' performance (SIMD)"

sound very interesting, but will most likely need a ton of adaptation or more. And of course there's the old trick of just compiling the whole thing with icc instead (which I'm not very eager to attempt anyway)


Has anyone tried some of these patches already, or is willing o give it a go?
Back to top
View user's profile Send private message
Jupiter1TX
Guru
Guru


Joined: 24 Feb 2006
Posts: 546
Location: 3rd Rock

PostPosted: Sat Jun 09, 2012 2:19 am    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic-t-302479.html
_________________
Core i7 920 D0 | Asus P6T DLX | Patriot Viper 1600 6GB | Antec Quattro 850W
Geforce 8800GTX OC2 768MB | Dell 22" LCD | Koolance Exos2/Swiftech GTZ
GCC 4.6.1 | 3.7.x-geek | Xorg-7.4-x | KDE-4.7.x | Compiz
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Sat Jun 09, 2012 5:45 am    Post subject: Reply with quote

Jupiter1TX wrote:
https://forums.gentoo.org/viewtopic-t-302479.html

That thread is from 2005 and it doesn't even discuss patching...
Back to top
View user's profile Send private message
Dont Panic
Guru
Guru


Joined: 20 Jun 2007
Posts: 322
Location: SouthEast U.S.A.

PostPosted: Sat Jun 09, 2012 9:10 pm    Post subject: Reply with quote

My impression is that people on the Linux side who are looking for speed in their browser are thinking along the lines of Chromium, Midori, Opera, etc.

With the available alternatives, there's less interest in optimizing Firefox in Linux (especially compared to a few years back).
Back to top
View user's profile Send private message
xunxun1982
n00b
n00b


Joined: 30 Jun 2012
Posts: 3

PostPosted: Sat Jun 30, 2012 8:26 pm    Post subject: Re: Optimizing Firefox Reply with quote

haarp wrote:
Greetings.

I've seen that there are a bunch of optimized Windows Firefox builds in the wild, some of which claim to offer enormous performance improvements.
(source) Mashed_up's comments indicate that there are a bunch of patches.

And indeed, looking at pcxfirefox, bullet points such as
"Multithread load depending on tmemutil module (OpenMP)" or
"Improve some math functions' performance (SIMD)"

sound very interesting, but will most likely need a ton of adaptation or more. And of course there's the old trick of just compiling the whole thing with icc instead (which I'm not very eager to attempt anyway)


Has anyone tried some of these patches already, or is willing o give it a go?


Well, I am the maintainer of pcxfirefox.

What I want to say is that my most patches can't be used for Linux target (or some need to be redesigned).
But Firefox on Linux also can use my BetterPGO method, which will improve the performance greatly.

Gentoo is my most favorite linux distro, and I think Firefox is the first choice on Linux, so there is no need to do something.
If you want to provide it, you can pass CFLAGS/CXXFLAGS/LDFLAGS to build process using:

CFLAGS or CXXFLAGS:
-O2 -march=native -mtune=core-avx-i -fivopts -fmodulo-sched -fmodulo-sched-allow-regmoves -fomit-frame-pointer -finline-functions -minline-all-stringops -flto (GCC4.6.1 AVX optimization may cause wrong code, you can use -mno-avx or GCC4.7.1 or latest GCC4.6 branch)

LDFLAGS:
-flto -fuse-linker-plugin

The options can also improve the performance remarkably.
Back to top
View user's profile Send private message
xunxun1982
n00b
n00b


Joined: 30 Jun 2012
Posts: 3

PostPosted: Sat Jun 30, 2012 8:34 pm    Post subject: Reply with quote

And you also can use GCC Link elimination optimization to reduce the package greatly

pass CFLAGS and CXXFLAGS using -ffunction-sections -fdata-sections

pass LDFLAGS using -Wl,--gc-sections


ps : The GCC Link elimination optimization methods can't be used on MinGW/Cygwin target GCC, though there is one experimental patch, which only can be used for static libs. Someone including me will continue to work for it when we are free.
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Thu Jul 05, 2012 8:18 am    Post subject: Reply with quote

Oh my, that's a lot of CFLAGS. I'd be surprised if nothing breaks with those. I'll give them a go nonetheless. Thank you!
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Thu Jul 05, 2012 10:40 am    Post subject: Reply with quote

haarp wrote:
Oh my, that's a lot of CFLAGS. I'd be surprised if nothing breaks with those. I'll give them a go nonetheless. Thank you!


those flags are fine I used most of them on a system-wide basis
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Thu Jul 05, 2012 10:50 am    Post subject: Reply with quote

kernelOfTruth wrote:
haarp wrote:
Oh my, that's a lot of CFLAGS. I'd be surprised if nothing breaks with those. I'll give them a go nonetheless. Thank you!


those flags are fine I used most of them on a system-wide basis

Heh. Yeah.

I think I'll try just LTO first. The others look stupidly suicidal, even if it's just for the browser.
Back to top
View user's profile Send private message
Apheus
Guru
Guru


Joined: 12 Jul 2008
Posts: 422

PostPosted: Thu Jul 05, 2012 11:46 am    Post subject: Reply with quote

You will run into more problems with LTO than with the CFLAGS, look at this thread for example.

Regarding CFLAGS - keep away from flags which try to auto-parallelize execution. Some packages have problems with graphite (-floop-interchange -floop-strip-mine -floop-block). I have run into problems with -ftreep-loop-distribution and Qt. Apart from that, they are usually "safe". Far from suicidal...

Edit: Before I forget - I keep the most basic system packages on "-O2 -finline-functions". Things like glibc, libtool, binutils, gcc, coreutils, openrc and sysvinit, shells...
Back to top
View user's profile Send private message
xunxun1982
n00b
n00b


Joined: 30 Jun 2012
Posts: 3

PostPosted: Sat Jul 07, 2012 2:42 am    Post subject: Reply with quote

If you like -flto or -fuse-linker-plugin to build firefox, I suggest you to use newer gcc than 4.7.1 (including 4.7.1), which fix many lto bugs.

If you want to use graphite options, please don't use gcc older than 4.7.1, which will cause many wrong code (especially with -ftree-loop-distribution).
And after my test, at present, graphite options can't give us the significant performance (only less than 1%-5%).


For most users, "-O2 -finline-functions -march=pentium4 -mtune=core-avx-i" is very safe.

-march=pentium4 may be replaced with -march=native, but if you use older than gcc4.6.3 and AVX CPU, you should use -march=natvie -mno-avx (or will cause crash problems).
Back to top
View user's profile Send private message
eLusive
n00b
n00b


Joined: 09 Oct 2012
Posts: 4

PostPosted: Sun Oct 14, 2012 3:04 pm    Post subject: Reply with quote

Dont Panic wrote:
My impression is that people on the Linux side who are looking for speed in their browser are thinking along the lines of Chromium, Midori, Opera, etc.

With the available alternatives, there's less interest in optimizing Firefox in Linux (especially compared to a few years back).


I fail to see why we shouldn't have a good browser out of the box, so to speak.
My firefox often has a few windows open with a handful of tabs each, over four workstations and it can consume beyond 100% cpu on a single process and about 20%+ memory. This is concerning because I have an i7 2600k with 16GB of memory.

Yet my firefox and flash lag pretty badly...
I don't want to move from Firefox as I'm happy with how it works everywhere other than Gentoo, so clearly there's something I've missed.

CFLAGS provided here don't appear to be helpful in the matter.
Back to top
View user's profile Send private message
ryszardzonk
Apprentice
Apprentice


Joined: 18 Dec 2003
Posts: 225
Location: Rzeszów, POLAND

PostPosted: Sat Nov 03, 2012 5:09 pm    Post subject: Re: Optimizing Firefox Reply with quote

xunxun1982 wrote:
What I want to say is that my most patches can't be used for Linux target (or some need to be redesigned).
But Firefox on Linux also can use my BetterPGO method, which will improve the performance greatly.


I would like to try this newer method. Please let me know just I go about trying to find this stuff out. Info about which patches in which order would be quite welcomed :)
_________________
Sky is not the limit...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum