[Mono-list] Performance

Tomi Pakarinen tomi.pakarinen@welho.com
15 Jan 2003 21:59:19 +0200


 Hi.

I compared Portable.NET & Mono with this test. I got some quite
intresting results.
 

 Mono 0.18
 Pnet 0.5.0
 Amd 1.33 GHz

patope:~/Projects/mono/omat% cscc perf.cs -o perf_pnet.exe
patope:~/Projects/mono/omat% mcs perf.cs -o perf_mono.exe
Compilation succeeded

patope:~/Projects/mono/omat% mono perf_mono.exe
Time taken: 00:00:03.3260720
Time taken: 00:00:03.2472450
Time taken: 00:00:03.2428290

patope:~/Projects/mono/omat% mono perf_pnet.exe
Time taken: 00:00:02.5166270
Time taken: 00:00:02.4324730
Time taken: 00:00:02.4951060

patope:~/Projects/mono/omat% ilrun perf_mono.exe
Time taken: 00:00:43.953031
patope:~/Projects/mono/omat% ilrun perf_pnet.exe
Time taken: 00:00:44.827609

   Is Pnet's ilrun interpreter?


ildasm perf_mono.exe
        ...
        ?L210d:
                ldloc.1
                ldc.i4.1
                add
                stloc.2           
                ldloc.2           
                stloc.1
        ?L2113:
                ldloc.1
                ldc.i4     1000000000
                blt        ?L210d


ildasm perf_pnet.exe
        ...
        ?L2066:
                ldloc.1
                ldc.i4.1
                add
                stloc.1
        ?L206a:
                ldloc.1
                ldc.i4     1000000000
                blt.s      ?L2066
         ...


 Here is some disassembly from mono's jit compiler.

mono -d perf_mono.exe
....
  29:   be 00 00 00 00          mov    $0x0,%esi
  2e:   e9 07 00 00 00          jmp    3a <.PerformanceTester_Main+0x3a>
  33:   8b c6                   mov    %esi,%eax
  35:   40                      inc    %eax
  36:   8b d8                   mov    %eax,%ebx
  38:   8b f3                   mov    %ebx,%esi
  3a:   81 fe 00 ca 9a 3b       cmp    $0x3b9aca00,%esi
  40:   0f 8c ed ff ff ff       jl     33 <.PerformanceTester_Main+0x33>
....


mono -d perf_pnet.exe
00000000 <.PerformanceTester_Main>:
....
  29:   be 00 00 00 00          mov    $0x0,%esi
  2e:   e9 01 00 00 00          jmp    34 <.PerformanceTester_Main+0x34>
  33:   46                      inc    %esi
  34:   81 fe 00 ca 9a 3b       cmp    $0x3b9aca00,%esi
  3a:   0f 8c f3 ff ff ff       jl     33 <.PerformanceTester_Main+0x33>
....



Tomi.


On Tue, 2003-01-14 at 23:51, Simon Ask Ulsnes wrote:
> You all probably know this already, but I thought it was quite funny to write a tiny performance test program to see if there was any difference between Mono and Microsoft .NET Framework 1.0.3705. There was:
> 
> Red Hat Linux 8.0 running Mono 0.18: Approx. 7.2 seconds
> Windows XP running MS .NET Framework 1.0.3705: Approx 5.02 seconds
> 
> My program basically counts 1 million and prints out how long it took.
> 
> The test was performed on my computer, which is an Athlon 650 Mhz.
> 
> Many of you will probably consider this information irrelevant, but I think it is a little interesting.
> I don't know whether the difference of about 2 seconds is because one was on Linux and the other on Windows or because one was with Mono and the other was on .NET Framework.
> 
> Source attached...
> 
> // Simon
> // This sentence no verb.
> ----
> 

> using System;
> 
> public class PerformanceTester
> {
> 	public static void Main(string[] args)
> 	{
> 		DateTime dstart = DateTime.Now;
> 		int i = 0;
> 		while (i<1000000000)
> 		{
> 			i++;
> 		}
> 		Console.WriteLine("Time taken: "+DateTime.Now.Subtract(dstart).ToString());
> 	}
> }