This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cross-class inlining


On Wed, 22 Oct 2003, Robin Garner wrote:
> Under what circumstances does it do this inlining ?  I tried this:
>
> gcc -O3 -o a.o a.java
> gcc -O3 -o b.o b.java a.java
> gcc -O3 -o c.o c.java a.java
> gcc -O3 -o d.o d.java c.java a.java

The current inliner requires the statement tree to be available for all
methods that are inlining candidates.  So, if gcj hasn't seen the source
code for a method X, it can't inline X.

Inlining is considered only after all source code has been parsed.  It
works independent of declaration order, or order of source files on the
command line.

> Still, the "all in 1" approach gets a 49% speedup over just -O3 on
> individual modules, and 17% better than I could do by hand.

Excellent.  This "all in 1" approach may get faster still in the future
due to whole-program optimizations.

I've been converting my own projects to build this way, if for no reason
other than faster build times.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]