On the previous thread about the article with those microbenchmarks comparing java with C++ somebody on that ‘Comments’ board posted some real code (a mandelbrot generator) which he converted from C to Java. On 1.4.2_04 client, it was about 8% slower.
I did a little change without altering the algo’s in any way (I just made everything non static) and got to almost exactly the same performance as the C version.
Did another test on 1.5.0 beta 2 client and behold: the java version is even faster than the C version.
But: when I test on the server (both 1.4.2 and 1.5.0), the results are very disappointing. The server performs the test ~30% slower than the client!
As a matter of fact, I’ve seen this kind of bad performance of the server VM very often (for example in a program I wrote for a customer where huge text files are converted to even more huge XML documents).
This particular test runs 100 times (which means 100 times 15 seconds total), but performance doesn’t get any better over time.
Anybody has an idea?
I know it’s yet another benchmark, but the fact that I keep seeing the server VM perform so badly kind of worries me :-/