Java can be significantly faster than C
Join the DZone community and get the full member experience.
Join For FreeWhether you use Java or C is not always as important as the algorithm you use. Being smarter can make more difference.
You might not see this as a fair test of Java vs C, but in the real
world human factors are matter. There is no point saying C is faster in
theory but there isn't anyone available to make it so. Its like
getting a very cheap price on an item which is not in stock. ;)
Benchmark Shootout
Java is temporarily the fastest for this particular knucleotide benchmark. It is quite likely that if the algorithm I used is translated to C it would be faster again. But for the moment Java is fastest because it uses a different approach in a number of key places.
Benchmark results at Wed 31st August 2011.
If anyone is interested in translating it to C, I would like to know how much faster it is. ;)
Making it faster again
On my home PC it only takes 0.684 ms, a gain of 2.5x. My PC uses newer hardware (and an over clocked CPU)
From http://vanillajava.blogspot.com/2011/08/java-can-be-significantly-faster-than-c.html
Opinions expressed by DZone contributors are their own.
Comments