[Mono-dev] Mono Performance Solaris/Linux/Windows

pablosantosluac at terra.es pablosantosluac at terra.es
Tue Oct 20 20:33:44 EDT 2009


Hi,

We're running a simple program like the following on Mono/Linux,
Mono/OpenSolaris, .NET/Windows. Same hardware (QuadCore Xeon 64bits).

The results are very interesting: Linux/Mono is a little bit faster than
Windows/.NET and OpenSolaris/Mono a little bit slower.

(FYI: we wrote the same code in Java, and running with the default VM,
Mono is *always* faster)

Ok, here comes the questions and remarks:

Solaris with Mono 2.2 is a little bit faster (about a 20% or so) than
Mono 2.7 (just built from trunk). Is there a good explanation for that?

Also, and more importantly: could you highlight some reasons why a test
like the one below is slower on Mono/OpenSolaris than Mono/Linux?


Thanks,


	pablo


Mono JIT compiler version 2.2 (/branches/mono-2-2/mono r125384 Tue Feb
3 10:53:16 CET 2009)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  x86
        Disabled:      none

Mono JIT compiler version 2.7 (/trunk/mono r144497 Wed Oct 21 01:58:57
CEST 2009)
Copyright (C) 2002-2009 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC and Parallel Mark)
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  x86
        Disabled:      none



 using System;
 using System.IO;
 using System.Collections;

 namespace hash_access
 {
   public class RevisionInfo
   {
       public long ItemId = -1;
       public short Type;            // Directory, Text, Binary, ...
       public long Size;
       public bool CheckedOut;
       public long ParentId = -1;
       public long BranchId = -1;
       public string RevisionNumber;
       public string Hash;
       public long Changeset;
       public bool Last;
   }

   class Class1
   {
       [STAThread]
       static void Main(string[] args)
       {
           int size = int.Parse(args[0]);
           int ini = Environment.TickCount;

           Hashtable hash = new Hashtable();
           ArrayList list = new ArrayList();

           for (int i = 0; i < size; i++)
           {
               RevisionInfo revInfo = new RevisionInfo();
               hash[i] = revInfo;
               //hash[i.ToString()] = revInfo;
               list.Add(revInfo);
           }

           for (int i = 0; i < size; i++)
           {
               RevisionInfo revInfo = hash[i] as RevisionInfo;
               revInfo = list[i] as RevisionInfo;
           }

           Console.WriteLine("{0} times: {1}ms", size,
Environment.TickCount - ini);
           Console.ReadLine();
       }
   }


More information about the Mono-devel-list mailing list