1 |
Mario Domenech Goulart wrote: |
2 |
> There's an interesting discussion in the OpenBSD mailing |
3 |
> list about the use of inline. |
4 |
|
5 |
There is no such thing as "best optimization". Some optimization |
6 |
techniques tend to show better performance on the average, but given a |
7 |
specific code, the same technique can fail dramatically. |
8 |
|
9 |
Inlining makes the code faster if the called function is small |
10 |
(preferably smaller than a cache-line), and called only a few times. No |
11 |
inlining will result in faster code if the function is large (at least |
12 |
one complete cache-line is used), and that function has a good chance to |
13 |
be already in the cache when called. |
14 |
|
15 |
Also inlined functions allow the block-reordering code to do interesting |
16 |
things. Block-reordering was introduced in gcc3, BSDs are using |
17 |
gcc-2.95, AFAIK. |
18 |
|
19 |
So far the facts. |
20 |
|
21 |
Now the manual says that for gcc the inline-limit is 600 bytes, compared |
22 |
to the 32-128 byte cache line size of the x86 CPUs. It could be worth to |
23 |
try lower numbers with inline-functions... |
24 |
|
25 |
|
26 |
/Ervin |
27 |
|
28 |
-- |
29 |
gentoo-performance@g.o mailing list |