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: PATCH: Improve Java build times


On Sun, May 19, 2002 at 09:58:56AM -0700, Mark Mitchell wrote:
> 
> I analyzed why building libjava (and presumably any other Java
> program) took so long to build.
...

> 
> 1. Cache negative lookups of class names so that we do not do them 
>    again.  (This is the part of the patch responsible for the
>    reduction in user time; we avoid running through the linked list
>    of directories.)
> 
> 2. Cache the contents of directories in the class path (using scandir
>    to read the directory) and avoid calling stat for files we know do
>    not exist.

I see that find_class uses stat() to determine whether files exist,
then calls open() later on its final choice.  This incurs an extra
in-kernel namei (directory walk) operation on systems that don't have
a "dcache" (i.e. everyone except Linux and *BSD).  There is an
additional performance gain to be had from switching this around, so
that it determines whether files exist by calling open(), then uses
fstat() to get at the modification times.

Also, JCF_USE_STDIO is defined nowhere -- suggest ripping out that
option entirely.  Code that uses stat does not gain any portability
from using stdio.

A broader question: Why is this code using the obsolete DEFUN()
notation?  These programs are only compiled with GCC - why do they
have K+R compat notation at all?

zw


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