[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

JAVA vs. C in speed



Hi all!

I'm doing some number crunching using JAVA in an application. I'm using a large number of Arrays , and thats where I thought my JAVA code will be spending so much of its time (as JAVA checks every Array access for ArrayIndexOutOfBoundsException). So, in order to improve the speed of my program I coded the routines as JNI native stubs, and timed it. 

To my surprize, the JAVA code is as fast as the C code as far as number crunching and Arays are involved! Calling the native methods takes an additional 1/2 ms, and so eventually the pure JAVA code seems to be running faster, atleast with my experiments!

Have others also experienced such issues?
Does anyone know of good relaible comparisons between JAVA and C wrt speed ? If yes, 0xCAFEBABE would be glad
to know about them

Thanks,
0XcafeBAbe


_________________________________________________
Chat with your friends as soon as they come online.
Get Rediff Bol from http://www.rediff.com/messenger/messenger.htm

Participate in crazy Re.1 auctions at http://www.rediff.com/auctions