3 ms·
I tested simple a simple Go program with a for loop counting from 1 to several millions and making simple integer calculations and the same with Java. Java was
by markokrajnc 14y ago
I tested simple a simple Go program with a for loop counting from 1 to several millions and making simple integer calculations and the same with Java. Java was 4-5x faster than Go.
It looks like HotSpot VM is preety much optimized and that Go still needs a lot of compiler optimizations...
I know that this test isn´t representative and complete, but it is a good smoke test for first comparison. C and Go should be faster than Java in pure integer numerics (or at least as fast as Java)...
- supersillyus 14y agoWhy should C and Go (AOT compiled) be faster than Java for pure integer numerics? For long-running simple tight loops of numerics, I'd assume HotSpot would be faster.
- igouy 14y agoDon't assume -- measure.
- igouy 14y ago>>but it is a good smoke test for first comparison<< No it isn't. http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#benchmarking_simple http://www.oracle.com/technetwork/java/hotspotfaq-138619.htm... http://www.azulsystems.com/events/javaone_2002/microbenchmarks.pdf http://www.azulsystems.com/events/javaone_2002/microbenchmar... http://www.ibm.com/developerworks/java/library/j-jtp02225/index.html http://www.ibm.com/developerworks/java/library/j-jtp02225/in...