Linux/Compiler Options: Difference between revisions

Jump to navigation Jump to search
just include dwitte's comments directly
(add a note about how to use --enable-optimize)
(just include dwitte's comments directly)
Line 9: Line 9:
=Compilers=
=Compilers=


<table class="fullwidth-table">
Notes from dwitte on gcc 4.3 vs. 4.1.2. [https://bugzilla.mozilla.org/show_bug.cgi?id=409803#c17]  Also see the [https://bugzilla.mozilla.org/show_bug.cgi?id=409803#c0 original post] about possible ways to make gcc 4.1.2 faster as well by using -Os and -finline-limit.
<tr>
<th>Compiler + Options</th>
<th>Notes</th>
</tr>


<tr>
<pre>
<td>gcc 4.1.2 (-Os -freorder-blocks -fno-reorder-functions)</td>
i've tested gcc 4.3 a bit. to summarize, it looks like this pathological -Os
behavior is specific to 4.1 branch, and possibly just 4.1.2. also, there are
some substantial perf and codesize wins to be had with gcc 4.3.


<td>
gory details: tested with gcc 4.3 (20080104 pull). "stock configuration" is
"-Os -freorder-blocks -fno-reorder-functions". some Tp2 numbers:


Baseline for testingVery similar to our reference platform, which uses gcc 4.1.1. Those options above are the default options that we use for compiling.
baseline: gcc 4.3, stock:      142.78 ms
stock, with -finline-limit=50: 146.89 ms (+2.9%)
-O2:                            131.56 ms (-7.9%)


This compiler version apparently does not inline even trivial functions.[https://bugzilla.mozilla.org/show_bug.cgi?id=409803#c0]
for comparison with previous results (comment 0):
gcc 4.1.2, stock:              199    ms (+39%)
stock, with -finline-limit=50: 149.33 ms (+4.6%)
-O2:                            142.67 ms (even)


</td>
|size libxul.so|
</tr>
gcc 4.3, stock:                12,387kb
stock, with -finline-limit=50:  12,325kb (-62kb)
-O2:                            15,061kb (+2,674kb)


<tr>
gcc 4.1.2, stock:              13,249kb (+862kb)
<td>gcc 4.2.1 (-Os -freorder-blocks -fno-reorder-functions -finline-limit=50)</td>
stock, with -finline-limit=50:  13,025kb (+638kb)
-O2:                            15,440kb (+3,053kb)


<td>
a few points from this data:
Note the use of -finline-limit=n. This will force many small functions and helpers to be inlined.  (-O2 uses 600 as a value, for example.) On a 32-bit Linux build this results in:
1) -Os is very sane on 4.3 by default.
2) on 4.3, relative to -Os, -O2 has improved a lot (8% Tp win, although at a
2.7Mb codesize cost).
3) 4.3 is 5 - 8% faster on Tp2 than 4.1.2, depending on -Os/-O2.
4) 4.3 gives an 400-800k codesize saving over 4.1.2.


codesize saving of 225kb (2%)<br/>
3 & 4) are probably the same thing - a result of the hidden visibility
Ts win of 3%<br/>
propagation improvements introduced in gcc 4.2. these are a major win for us.
Txul win of 18%<br/>
Tp2 win of about 25% (!)<br/>
</td>
</tr>
 
<tr>
<td>gcc 4.2.1 (-O2 -freorder-blocks -fno-reorder-functions)</td>
 
<td>
Comparing -O2 vs. -Os -finline-limit=50, not directly against baseline. [https://bugzilla.mozilla.org/show_bug.cgi?id=409803#c0]
 
 
Txul is unchanged<br/>
Ts improves 3%<br/>
Tp2 improves about 4%<br/>
however, codesize jumps 2,414kb (19%)
</td>
 
</table>


=Distributions=
=Distributions=
canmove, Confirmed users
1,577

edits

Navigation menu