[Mono-dev] Mono runtime performance

Gary Smithrud gary.smithrud at haley.com
Wed Sep 14 09:28:56 EDT 2005


I would suggest build the Mono version with optimizations on and  
seeing the performance differences as well.  Of course this is not a  
total surprise, since Mono is newer than .NET and as such the goal  
should be first to get it right and then to speed it up.

On Sep 14, 2005, at 8:18 AM, Graeme Geldenhuys wrote:

> Hi,
>
> I came across a article on the net, that compares different  
> languages and
> there performance (Java, C#, C++, etc..).  I thought I would try  
> something
> simular, but testing the execution speed of the .net runtimes for  
> Microsoft
> .NET 1.1 and Mono 1.1.8.3
>
> I compiled the C# benchmark application using Mono. It didn't make a
> difference which framework I used to compile the benchmark  
> application, as the
> result was very simular.  I also didn't include optimization params  
> to the
> compiler, otherwise Microsoft's .NET can't execute the Mono created
> application. (I got no idea why, but it does work other way round).
>
> Anyway, the result was shocking!  The mono runtime was about 67%  
> slower than
> the microsoft runtime.  Anybody know why?  I was testing this under  
> Windows
> 2000 Pro + SP2 applied.  My PC is a Dell Inspiron 9100 laptop with  
> a 3000Mhz
> P4 and 512mb RAM.
>
> Below is the output of the same executable, first run under Mono,  
> then under
> MS's .NET framework.
>
>
>
> Test System:
>  Dell Inspiron 9100 laptop
>  Intel P4 3000Mhz
>  512Mb RAM
>  OS: Windows 2000 Pro with SP2
>
> Microsoft.NET Framework v1.1.4322
> Mono .NET Framework v1.1.8.3
>
> Compiled with Mono 1.1.8.3 and no optimization
> (even with optimized compiler settings, the results are very similar)
> ---------------------------------------------------------------------
> c:\Temp\benchmarks>gmcs Benchmarks.cs
>
>
> Run via Mono's .NET
> -------------------
> c:\Temp\benchmarks>mono Benchmarks.exe
> Start C# benchmark
> Int arithmetic elapsed time: 15297 ms with max of 1000000000
>  i: 1000000000
>  intResult: 1
> Double arithmetic elapsed time: 30813 ms with min of 10000000000,  
> max of
> 1100000
> 0000
>  i: 11000000000
>  doubleResult: 10011632717.4955
> long arithmetic elapsed time: 33703 ms with min of 10000000000, max of
> 110000000
> 00
>  i: 11000000000
>  intResult: 776627965
> Trig elapsed time: 2891 ms with max of 10000000
>  i: 10000000
>  sine: 0.990664647736125
>  cosine: -0.136321516004849
>  tangent: -7.26711877016455
>  logarithm: 6.99999995657055
>  squareRoot: 3162.27750205449
> IO elapsed time: 14172 ms with max of 1000000
>  i: 1000001
>  myLine:
> abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz12345678 
> 9
> 0abcdefgh
> Array elapsed time: 797 ms - 1000 100000000
> Exception elapsed time: 3765 ms - Exceptions: HI=500000 / LO=500000
> HashMap elapsed time: 407 ms - 18699
> HashMaps elapsed time: 5890 ms - 1 9999 1000 9999000
> HeapSort elapsed time: 844 ms - 0.999992855509831
> Vector elapsed time: 17078 ms - 10000
> Matrix Multiply elapsed time: 75688 ms - 270165 1061760 1453695  
> 1856025
> Nested Loop elapsed time: 17515 ms - -1804337152
> String Concat. (fixed) elapsed time: 610 ms - 50000000
> Total C# benchmark time: 219470 ms
> End C# benchmark
>
>
>
> Run via Microsoft's .NET
> ------------------------
> c:\Temp\benchmarks>Benchmarks.exe
> Start C# benchmark
> Int arithmetic elapsed time: 6593 ms with max of 1000000000
>  i: 1000000000
>  intResult: 1
> Double arithmetic elapsed time: 12140 ms with min of 10000000000,  
> max of
> 1100000
> 0000
>  i: 11000000000
>  doubleResult: 10011632717.4955
> long arithmetic elapsed time: 16546 ms with min of 10000000000, max of
> 110000000
> 00
>  i: 11000000000
>  intResult: 776627965
> Trig elapsed time: 2828 ms with max of 10000000
>  i: 10000000
>  sine: 0.990664647736125
>  cosine: -0.136321516004849
>  tangent: -7.26711877016455
>  logarithm: 6.99999995657055
>  squareRoot: 3162.27750205449
> IO elapsed time: 4640 ms with max of 1000000
>  i: 1000001
>  myLine:
> abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz12345678 
> 9
> 0abcdefgh
> Array elapsed time: 375 ms - 1000 100000000
> Exception elapsed time: 11968 ms - Exceptions: HI=500000 / LO=500000
> HashMap elapsed time: 125 ms - 18699
> HashMaps elapsed time: 4500 ms - 1 9999 1000 9999000
> HeapSort elapsed time: 703 ms - 0.999992855509831
> Vector elapsed time: 14734 ms - 10000
> Matrix Multiply elapsed time: 25640 ms - 270165 1061760 1453695  
> 1856025
> Nested Loop elapsed time: 29968 ms - -1804337152
> String Concat. (fixed) elapsed time: 500 ms - 50000000
> Total C# benchmark time: 131260 ms
> End C# benchmark
>
>
>
> I didn't write the Benchmark.cs application, I got it off the net.   
> I will
> include the code in the next email if anybody wanted to test it  
> themselves.
>
> Regards,
>   - Graeme -
>
>
>
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>




More information about the Mono-devel-list mailing list