dagblog.
← Archive

Java — A performance test


How to measure Java performance, and how well Java performs, keep coming up for discussion. You often hear claims, especially
 from C programmers, about how slow Java is. Petr Toman put together a 
 performance test, based on calculating 
 pi by summing a series. Java did quite well. For Java, the test gives interesting results
 when run with different JVMs.

Whenever someone takes a shot at Java’s speed, I think of a point
 Rudolf Pecinovský makes in discussion groups, one I agree with.

Java’s advantage over C is that you can work at a higher level of abstraction when developing a program.
 Its disadvantage is slower execution.
With simple programs the higher level of abstraction isn’t as noticeable, but with
 more complex ones you can certainly feel the difference. If I had to choose between
 writing a more complex program in C that spends 0.01 seconds computing and 0.99 seconds
 waiting for the next event, and writing a program in Java that
 spends 0.5 seconds computing and 0.5 seconds waiting for the next event, I’d probably choose
 Java because it would be easier for me to think in it.

Medium version

Related articles

Related CZ Podcast episodes