I was talking with someone the other day about Java vs .NET performance. I have never thought that much about it. He said that .NET was fast because it had a Just In Time compiler (“JIT”). I choked on my coffee. Java’s JVM has had a JIT for about 6 years now. Not only that, but I had never heard that .net was faster.
So, I decided to go and run some benchmarks for myself. Rather than dirty my machine by installing Windows, I fired up VMWare and installed it on a disposable file. I then started the arduous and frustrating experience of installing .net onto my VMWare pack of XP. Reading the EULA, I discovered that Microsoft had already foreseen the threat of benchmarks and banned disclosure of any benchmark information without written permission from them.
So, If I were to tell you that Java JVM based on JDK1.5 was 42% faster than .net’s CLR, based on a benchmark I had, that would be breaching the EULA. In reality I cannot even get started because of the mind boggling activation process required. Currently my 60 day trial activation key has been used too many times and my Visual Studio is disabled. I am enjoying the experience already!
There are some braver souls than me around. See http://www.shudo.net/jit/perf/. There benchmarks are current. They were last updated in December. They show that on SciMark, Java scored 324 vs .NET of 240. On Linpack, Java scored 413 vs .net’s 282. Adding the scores together gives 737 for Java and 522 for .net.
On their site there is a lot of detail and a lot of different versions. Check it out.
So, in complete agreement with the EULA, I can tell you that Java’s VM is 42% faster than .net’s CLR.
And the next time someone claims that .net is faster because it “has a JIT compiler” point them at the site.
Comments