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: Exception Handling


> 
> Hello,
> 
> I am working with gcj for PowerPC linux, and was looking for some 
> insight into the cause of some poor benchmark performance on exception 
> handling, esp. when compiling java to native code.  The UCSD benchmark  
> (available from here http://waitaki.otago.ac.nz/~bryce/gcj/) was 
> **absurdly** dominated by exception handling time, especially when 
> compared to other java implementations.  I also ran the benchmark (also 
> compiled with gcj to native code) on an x86, and Sun SPARC computer as 
> well to make sure that it was a problem with gcj, not a PowerPC 
> specific issue.  I also noticed the problem when using gij to interpret 
> byte code (even byte code that had been compiled w/  Sun's javac).
> 
> To give you an idea of how slow exceptions are here are the results of 
> running the benchmark on a Sun Ultra 60, first compiled to native code 
> with -O3 using gcj vs. interpreted, unoptimized compile, using 
> javac/java. (I've included the full output at the end of this message). 
>   Even though gcj was about 20% faster with the exception test factored 
> out, it lost by a _factor_ of 15.2x overall just because of exception 
> handling.
> 
>                                     Exception Handling
>                 Total Time Taken         Test Time
> Compiler     (smaller is better)  (smaller is better)
> gcj -O3        67.765 seconds       66.224 seconds
> javac          4.472 seconds        2.646 seconds
> 
> 
> Does anybody know why exceptions in gcj are so slow?  How are they 
> currently implemented?

I think the one of the reason why exception handling is so slow on gcj is because
it has to talk to some external programs to get the line numbers for the backtrace.

The only thing I can say is exceptions should be just that the exception to the rule.

Thanks,
Andrew Pinski


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