Torque: C# and Java on Framework.NET, Mono, JSEE
by Funky Diver · 04/14/2006 (11:25 am) · 3 comments
Howdy
After recent discussions about using C# or Java with Torque with Jason Swearingen and Josh Ritter, I just decided to do some research and benchmark all those platforms.
The test code was small, so memory and the swapping were avoided; the C# code was created and compiled in VS2003 and VS2005, then run on FW.net v1.1 and v2.0, then the same code was ported to Java and compiled with Sun JDK 1.4. I also compiled the class file with ikvmc.mono into native executable, and it runs(!).
All the tests were executed on AMD 3700+/1Gb/SATAII(3Gb/s) under Win XP Pro (I didnt try it yet on Linux or Mac yet); Mono v1.1.14, JDK 1.4, FW v1.1, FW v2.0.
Java code compiled with JDK 1.5 doesnt run on Mono at'all.
Here're the execution time (average time after 3 runs):
Well...
Interesting facts:
* Mono still lacks the perfomance of FW.net under Windows (worse time: ~50% at min, ~110% at max).
* .NET v1.1 is faster then v2.0 (but may change after some updates from M$) on simple computation tasks (bloated vtables?).
* MONO executes .NET v2.0 code faster then v1.1 (was targeted, I guess)
* IKVM can compile java code into native and it runs as fast as JDK compiled JAR on WIndows, but uses more heap.
* FW.net uses less heap then Mono, but Mono startup time is less.
* Java is faster then FW.net v2.0, but slower FW.net v1.1 on Windows.
I dont have the test sources with me, but they are really simple:
Any thoughts?
After recent discussions about using C# or Java with Torque with Jason Swearingen and Josh Ritter, I just decided to do some research and benchmark all those platforms.
The test code was small, so memory and the swapping were avoided; the C# code was created and compiled in VS2003 and VS2005, then run on FW.net v1.1 and v2.0, then the same code was ported to Java and compiled with Sun JDK 1.4. I also compiled the class file with ikvmc.mono into native executable, and it runs(!).
All the tests were executed on AMD 3700+/1Gb/SATAII(3Gb/s) under Win XP Pro (I didnt try it yet on Linux or Mac yet); Mono v1.1.14, JDK 1.4, FW v1.1, FW v2.0.
Java code compiled with JDK 1.5 doesnt run on Mono at'all.
Here're the execution time (average time after 3 runs):
-= C# =- Executable compiled under FW.net v1.1: .NET v1.1 - 12.484 ms (used heap - 4180 Kb) Mono - 35.358 ms (used heap - 6044 Kb) Executable compiled under FW.net v2.0: .NET v2.0 - 20.984 ms (used heap - 4144 Kb) Mono - 34.8 ms (used heap - 6628 Kb) -= Java =- JAR compiled under JDK 1.4: java (1.4) - 15.610 ms (used heap - 6196 Kb) mono (ikvm) - 50.782 ms (used heap - 27024 Kb) EXE compiled with ikvmc from JAR: native - 15.890 ms (used heap - 11276 Kb)
Well...
Interesting facts:
* Mono still lacks the perfomance of FW.net under Windows (worse time: ~50% at min, ~110% at max).
* .NET v1.1 is faster then v2.0 (but may change after some updates from M$) on simple computation tasks (bloated vtables?).
* MONO executes .NET v2.0 code faster then v1.1 (was targeted, I guess)
* IKVM can compile java code into native and it runs as fast as JDK compiled JAR on WIndows, but uses more heap.
* FW.net uses less heap then Mono, but Mono startup time is less.
* Java is faster then FW.net v2.0, but slower FW.net v1.1 on Windows.
I dont have the test sources with me, but they are really simple:
start_time = current_time();
for (i = 0; i < int.MaxValue(); i++)
{
r *= i + 1;
}
total_time = current_time() - start_time;int is equal on all the tested platforms, 32 bits.Any thoughts?
About the author
#2
http://shootout.alioth.debian.org/
04/14/2006 (12:43 pm)
You can try some tests from here, and look at what the other languages are benching : http://shootout.alioth.debian.org/
#3
@Joe: thank for the link! though, I've seen it before, I wanted to make test myself, and, in average, it follows the results from that site.
04/15/2006 (3:30 pm)
@Phil: you have a good point, on the other hand, such test shows how fast VM on a simple task (just crunching numbers, no function calls, no disk I/O); I proved (atleast for myself) that the current version of mono is slower then FW.net, and the difference between fw.net and java is not that big. I will definetly continue the research to cover more cases, it's just the first stage ;).@Joe: thank for the link! though, I've seen it before, I wanted to make test myself, and, in average, it follows the results from that site.

Torque 3D Owner Phil Carlisle
you need more coverage.