canmove, Confirmed users
1,577
edits
(add note about using the chart below) |
(revise based on dwitte's comments) |
||
| Line 3: | Line 3: | ||
==Proper use of compiler options== | ==Proper use of compiler options== | ||
''' | '''For Firefox 3 builds, please use --enable-optimize without flags.''' | ||
Our testing has shown that different parts of Mozilla run faster at different optimization levels. For example, cairo, pixman and sqlite are compiled at -O2 because they are fastest at that level while the JS engine is fastest at -Os. [https://bugzilla.mozilla.org/show_bug.cgi?id=409803#c9] Don't use --enable-optimize as a place to pass in random compile flags. That's a global setting that sets optimization levels [http://lxr.mozilla.org/seamonkey/search?string=MODULE_OPTIMIZE_FLAGS throughout the source tree] and is different depending on the module being compiled. | |||
If you still need to pass in other non-optimization flags to the compile, please use CFLAGS and CXXFLAGS instead of passing them to --enable-optimize. | |||
'''For Firefox 2 builds, you probably want to set a default optimization level.''' | |||
The default optimization level on the 1.8 branch (a.k.a Firefox 2) is -O3 which is too aggressive and trades off a lot of space for not much speed. So you probably want to use --enable-optimize="..." for this release. | |||
If you're using gcc 4.1.x you should use -O2 to make things go as fast as possible. This will result in about a 2MB code size hit. If you want to avoid that code size hit you can specify "-Os -finline-limit=100" which gives back most of the performance without too much code size growth. See the notes below. | |||
For gcc 4.3.x you can use -O2 for your builds. The size hit is smaller because of visibility changes in that release of the compiler. | |||
=Compilers= | =Compilers= | ||