Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

Optimizing Firefox

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
13 posts • Page 1 of 1
Author
Message
haarp
Guru
Guru
Posts: 535
Joined: Wed Oct 31, 2007 12:44 pm

Optimizing Firefox

  • Quote

Post by haarp » Fri Jun 08, 2012 9:15 pm

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?
Top
Jupiter1TX
Guru
Guru
User avatar
Posts: 546
Joined: Fri Feb 24, 2006 6:47 pm
Location: 3rd Rock
Contact:
Contact Jupiter1TX
Website

  • Quote

Post by Jupiter1TX » Sat Jun 09, 2012 2:19 am

http://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
Top
haarp
Guru
Guru
Posts: 535
Joined: Wed Oct 31, 2007 12:44 pm

  • Quote

Post by haarp » Sat Jun 09, 2012 5:45 am

Jupiter1TX wrote:http://forums.gentoo.org/viewtopic-t-302479.html
That thread is from 2005 and it doesn't even discuss patching...
Top
Dont Panic
Guru
Guru
User avatar
Posts: 322
Joined: Wed Jun 20, 2007 4:36 pm
Location: SouthEast U.S.A.
Contact:
Contact Dont Panic
Website

  • Quote

Post by Dont Panic » Sat Jun 09, 2012 9:10 pm

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).
Top
xunxun1982
n00b
n00b
Posts: 3
Joined: Sat Jun 30, 2012 8:09 pm

Re: Optimizing Firefox

  • Quote

Post by xunxun1982 » Sat Jun 30, 2012 8:26 pm

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.
Top
xunxun1982
n00b
n00b
Posts: 3
Joined: Sat Jun 30, 2012 8:09 pm

  • Quote

Post by xunxun1982 » Sat Jun 30, 2012 8:34 pm

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.
Top
haarp
Guru
Guru
Posts: 535
Joined: Wed Oct 31, 2007 12:44 pm

  • Quote

Post by haarp » Thu Jul 05, 2012 8:18 am

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!
Top
kernelOfTruth
Watchman
Watchman
User avatar
Posts: 6111
Joined: Tue Dec 20, 2005 10:34 pm
Location: Vienna, Austria; Germany; hello world :)
Contact:
Contact kernelOfTruth
Website

  • Quote

Post by kernelOfTruth » Thu Jul 05, 2012 10:40 am

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-fo ... scCD-4.9.0
https://github.com/kernelOfTruth/pulsea ... zer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Top
haarp
Guru
Guru
Posts: 535
Joined: Wed Oct 31, 2007 12:44 pm

  • Quote

Post by haarp » Thu Jul 05, 2012 10:50 am

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.
Top
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

  • Quote

Post by Apheus » Thu Jul 05, 2012 11:46 am

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...
Top
xunxun1982
n00b
n00b
Posts: 3
Joined: Sat Jun 30, 2012 8:09 pm

  • Quote

Post by xunxun1982 » Sat Jul 07, 2012 2:42 am

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).
Top
eLusive
n00b
n00b
Posts: 4
Joined: Tue Oct 09, 2012 1:01 pm

  • Quote

Post by eLusive » Sun Oct 14, 2012 3:04 pm

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.
Top
ryszardzonk
Apprentice
Apprentice
User avatar
Posts: 225
Joined: Thu Dec 18, 2003 5:25 pm
Location: Rzeszów, POLAND

Re: Optimizing Firefox

  • Quote

Post by ryszardzonk » Sat Nov 03, 2012 5:09 pm

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...
Top
Post Reply

13 posts • Page 1 of 1

Return to “Unsupported Software”

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 Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy