Performace guidlines (tipps)?

Bryce McKinlay
Wed Jul 31 20:38:00 GMT 2002

Clemens Eisserer wrote:

> I want to write some gnu-apps which should be primary optimizied for gcj.
> Are there some performance tipps whats better and faster? Are there
> somewhere written guidlines avaible?

For the most part the same performance guidelines you apply to regular 
Java code should be applied to GCJ. In particular you should try to 
avoid unneccessary synchronization and avoid creating too many 
short-lived objects, instead re-using existing ones wherever possible. 

> I'm currently using gcj-3.0.4. Will an upgrade enhace performance over 
> 20%?

You should find that 3.1 and up have improved performance over 3.0.x, it 
probibly depends on your app exactly how substantial the difference is.

> one example:
> is  this better:
> class c;
> while(n>m)
> {
>     c=new class();
> }
> or is it better to create the "class c;" in the loop.

It should make no difference.



More information about the Java mailing list