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); })); }
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(); }