Performance comparison
Andrew Haley
aph@cambridge.redhat.com
Thu Aug 22 10:38:00 GMT 2002
Andrew Haley writes:
> Jeff Sturm writes:
> > On 2002年7月29日, Andrew Haley wrote:
> > > I'm sure that's the main reason. Once we get global inlining working
> > > I expect to see a decent improvement.
> >
> > Provided that increased register pressure doesn't ruin the benefits of
> > inlining.
>
> I'm thinking of the many small methods that don't increase register
> pressure at all. The x86 is a nightmare in this regard, I grant you,
> so it may not benefit so much.
>
> > The new register allocator may help, too.
>
> > It'd be nice to have a study on the effects of inlining real-world code
> > with GCC on multiple targets. I haven't seen any, and chances are any
> > that already exist are obsolete anyway. Meanwhile I've noticed a lot more
> > hand-waving arguments than real numbers.
I was thinking of an example of code with a lot of method calls and
long-lived variables -- the sort of thing that could cause problems
with increased register pressure when inlining. I tried MD5 with and
without inlining, and the performance changes from
-O2: 999 Mbytes/second
-O2 -finline-functions: 1374 Mbytes/second
So, although there will undoubtedly be worse cases than this one, I
reckon that in general the reduced overhead of inlining will be a win.
Andrew.
More information about the Java
mailing list