コード例 #1
0
        public void Benchmark(uint page, string text)
        {
            Stopwatch sw = new Stopwatch();

            IndexMapper map = new IndexMapper((int)BlockSize);

            System.Console.WriteLine(text +
                                     StepTimer.Time(10, () =>
            {
                map.MapPosition(page);
                map.MapPosition(page);
                map.MapPosition(page);
                map.MapPosition(page);
                map.MapPosition(page);
                map.MapPosition(page);
                map.MapPosition(page);
                map.MapPosition(page);
                map.MapPosition(page);
                map.MapPosition(page);
            }));
        }
コード例 #2
0
        public static void TestMethod1()
        {
            MemoryPoolTest.TestMemoryLeak();
            int         blockSize = 128;
            IndexMapper map       = new IndexMapper(blockSize);
            CheckValues check     = new CheckValues(blockSize);

            uint lastAddress = (uint)Math.Min(uint.MaxValue, (long)check.BlocksPerPage * (long)check.BlocksPerPage * (long)check.BlocksPerPage * (long)check.BlocksPerPage - 1);

            //this line is to shortcut so the test is less comprehensive.
            for (uint x = 0; x <= lastAddress; x++)
            {
                map.MapPosition(x);
                check.Check(map, x);
            }
            MemoryPoolTest.TestMemoryLeak();
        }
コード例 #3
0
        public void Benchmark(uint page, string text)
        {
            Stopwatch sw = new Stopwatch();

            IndexMapper map = new IndexMapper((int)BlockSize);

            System.Console.WriteLine(text +
                              StepTimer.Time(10, () =>
                              {
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                                  map.MapPosition(page);
                              }));
        }
コード例 #4
0
        public static void TestMethod1()
        {
            MemoryPoolTest.TestMemoryLeak();
            int blockSize = 128;
            IndexMapper map = new IndexMapper(blockSize);
            CheckValues check = new CheckValues(blockSize);

            uint lastAddress = (uint)Math.Min(uint.MaxValue, (long)check.BlocksPerPage * (long)check.BlocksPerPage * (long)check.BlocksPerPage * (long)check.BlocksPerPage - 1);

            //this line is to shortcut so the test is less comprehensive.
            for (uint x = 0; x <= lastAddress; x++)
            {
                map.MapPosition(x);
                check.Check(map, x);
            }
            MemoryPoolTest.TestMemoryLeak();
        }