Показаны сообщения с ярлыком mono. Показать все сообщения
Показаны сообщения с ярлыком mono. Показать все сообщения

вторник, 23 августа 2011 г.

Linux - C# Collections

Hashtable t= new Hashtable ();
vs
Dictionary<int, int> t = new Dictionary<int, int> ();

for (0->5)
  fill()
    for (0->1 000 000)

for (0->5)
  read()
    for (0->1 000 000)



Hashtable Dictionary
Fill. Memory (bytes) 66,228,224 41,041,920

8,454,144 24,051,712

29,179,904 15,646,720

9,502,720 0

65,536 0
Fill. Time (ms) 223 211

151 120

189 122

245 113

201 122
Read. Memory (bytes) 8,978,432 0

17,367,040 0

8,650,752 0

0 0

131,072 0
Read. Time (ms) 65 33

67 23

110 24

78 24

94 36

среда, 27 июля 2011 г.

вторник, 19 июля 2011 г.

Linux - mono

Mono
Mono C# compiler version 2.6.7.0

using System;

namespace testn
{
    public class TestClass
    {
        public static void Main()
        {
            for (int i = 0; i < 5; i++)
                test ();
        }
       
        public static void test ()
        {
            long s = System.Environment.TickCount;
            int count = 100000000;
            for (int i=0; i < count; ++i)
            {
                int x = i/10;
            }
            long e = System.Environment.TickCount;
            Console.WriteLine(e-s);
        }
    }
}

> mcs testc#.cs
> ./testc#.exe

510
511
510
511
510