I’m wondering and researching in floating point calculations why Java is slower than C. Actually some algorithms doesn’t affect too much. C is faster than Java 3 or 4 times. But in floating point calculation there is a huge difference. Can anybody help me?
I’m wondering and researching in floating point calculations why Java is slower than C.
Share
Compilers for middle level languages such as C are smart enough to exploit vectorization and other techniques to provide speed for the same piece of functionality as compared to interpreters for high level languages such as Java who need to a one extra layer of converting the platform independent byte code to platform specific assembly.
Having said that Virtual machine comes with its own overheads for maintaining the state of your program for garbage collection and other activities such as Thread scheduling within the JVM.
To be more specific JAVA floating point operations hurt everyone.