Does Java Run Faster On .NET VM and Windows Azure?

By M. David Peterson
December 19, 2008 | Comments: 5

There's an interesting thread taking place over on the IKVM.NET mailing list. It starts with a post from Alberto Diez:


Dear all,

I have tried the IKVM tool with the Java library weka.jar; I have generated
the corresponding weka.dll and I have tried out some algorithms under .NET
framework (C#, Visual Studio 2005) with really surprising results: it works
better (it builds models faster and with less-consuming memory) than under
Java (Eclipse framework and directly under command prompt, with the jdk-jre
1.6.03 installed)!

I wonder if this is normal or I am doing something wrong...

Thanks in advance.

Kind regards,
Alberto.

Dr. Michael Kay then follows-up with:

Sounds good to me!

For Saxon I generally reckon the .NET code is slower than the native Java
equivalent by a factor of 1.2 to 1.5 - but that's on a fairly limited
sample. The .NET code has much faster warm-up time, so it's faster overall
for small jobs.

Michael Kay
http://www.saxonica.com/

Interesting, though not really all that surprising. Given the fact that:

  • Java is now open source
  • The IKVM.NET library is built on top of that source
  • The Java libraries are compiled to CIL just like any other .NET library
  • You've got a world class developer in Jeroen Frijters finding every possible way to tweak as much performance into the IKVM.NET VM and compiler
  • The .NET platform performs better under various circumstances and scenarios

... why wouldn't Java code run faster on the .NET platform, at least under these same circumstances and scenarios?

Oh, and BTW: Interested in running your Java code on Windows Azure? That's now possible too. :-)


You might also be interested in:

5 Comments

If tests had to deal with lots of floating point calculations then there is no surprise here. Java floating point performance is less than suboptimal.

Most likely you were not using the hotspot-server compiler, which in most cases generates better code than the .net runtime.
After all, the title is as stupid as can be - what has all this to do with windows azure. Looks very much like buzzword hunting.

@Clemens,

Next time you should actually read more than the title before commenting. Firstly, these were not /my/ results. I was just reporting on someone else's results. Secondly, re: Azure: read the last sentence. Actually, while you're at it, read more than just the title next time. It will help you understand the context just a tad bit better than you obviously do.

Hey, none of these comparison can be used to make sweeping generalizations. Making a statement that something is faster then something else is stupid at worse and opinion at best, because 1) it depends on your exact setup, needs and scenario, 2) systems can be tweaked along numerous parameters to easily move results in either direction.

Thanks a lot for your post,

if anybody is interested in integrating their Java applications with Azure Storage, today we released JAzure, a Java API for the Azure storage services.

News Topics

Recommended for You

Got a Question?