static void SizeAnalyzePerformance(int testScale = 30000, int testRound = 10) { int[] _empData = new int[testScale]; SerialQuicksort sqs = new SerialQuicksort(_empData); SerialMergesort sms = new SerialMergesort(_empData); ParallelQuicksort pqs = new ParallelQuicksort(_empData); ParallelMergesort pms = new ParallelMergesort(_empData); LibrarySort ls = new LibrarySort(_empData); pqs.SizePerformanceAnalyzer(testScale, testRound); pms.SizePerformanceAnalyzer(testScale, testRound); sqs.SizePerformanceAnalyzer(testScale, testRound); sms.SizePerformanceAnalyzer(testScale, testRound); ls.SizePerformanceAnalyzer(testScale, testRound); }
static void WriteData() { GetData(); SerialEnumerationSort ses = new SerialEnumerationSort(data); SerialMergesort sms = new SerialMergesort(data); SerialQuicksort nsq = new SerialQuicksort(data); ParallelQuicksort pqs = new ParallelQuicksort(data); ParallelMergesort pms = new ParallelMergesort(data); ParallelEnumerationSort pes = new ParallelEnumerationSort(data); ses.EnumerationSort(true); pqs.Quicksort(true); pms.ParallelMergeSort(true); sms.MergeSort(true); nsq.QuickSort(false, true); pes.EnumerationSort(true); }
static void AnalyzePerformance() { GetData(); ParallelQuicksort pqs = new ParallelQuicksort(data); SerialQuicksort rsqi = new SerialQuicksort(data); ParallelMergesort pms = new ParallelMergesort(data); SerialMergesort sms = new SerialMergesort(data); ParallelEnumerationSort pes = new ParallelEnumerationSort(data); SerialEnumerationSort ses = new SerialEnumerationSort(data); LibrarySort ls = new LibrarySort(data); rsqi.PerformanceAnalyzer(SerialQuicksort.SortMethod.randomizedImprovedQuicksort, 10); pqs.PerformanceAnalyzer(10); pms.PerformanceAnalyzer(10); // show the performance on given data ls.PerformanceAnalyzer(10); sms.PerformanceAnalyzer(10); ses.PerformanceAnalyzer(10); pes.PerformanceAnalyzer(10); }