private static void RunBenchmark_Natural( int length, int loopsPerRun) { var benchmark = new SpanSortPerf( SortingPerfUtils.InitNatural, TimSort <int> .Sort, length, loopsPerRun); double msPerSort = benchmark.Run(); Console.WriteLine($"TimSort<int>.Sort() [Natural]:\t{msPerSort} ms / sort"); }
private static void RunBenchmark_Random( int length, int loopsPerRun) { var benchmark = new SpanSortPerf( SpanSortPerfUtils.InitRandom, MemoryExtensions.Sort, length, loopsPerRun); double msPerSort = benchmark.Run(); Console.WriteLine($"Span<int>.Sort() [Random]:\t{msPerSort} ms / sort"); }