Different results of java and C verion of same program ?

Mark Wielaard mark@klomp.org
Fri Mar 10 09:18:00 GMT 2006


On Wed, 2006-03-08 at 11:06 +0100, David Balažic wrote:
> The main part of the program is a double loop, comparing each element of 
> a Vector
> with all other elements of the Vector (except itself).
> 
> Any ideas for speedup ?

A Vector is synchronized on all operations. If you don't need this try
using an ArrayList and loop over it with an Iterator. gcj might not
optimize away the synchronized accesses on Vector.

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java/attachments/20060310/d8c21fe6/attachment.sig>


More information about the Java mailing list