Cross-class inlining

Jeff Sturm jsturm@one-point.com
Wed Oct 22 12:06:00 GMT 2003


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



More information about the Java mailing list