Help with performance issues.

Anthony Green green@redhat.com
Mon Jul 30 05:31:00 GMT 2001


Bill wrote:
> The code spends most of it's time in various loops that look roughly like:
>
> while( list != null ) {
>   for( int i=list.data_offset;
>        i < MAX && Math.abs(list.data[i]-input[i]) < ERR;
>        i++ )
>     ;

Sun's JIT is almost certainly inlining Math.abs() and we probably aren't.
Try replacing this with a static final method in your class to see if it
gets inlined (put it before this method in your class definition).

It seems like gcj should be able to replace Math.abs() with __builtin_abs in
this case.  Does anybody think otherwise?

AG




More information about the Java mailing list