Go Sorting Algorithms Benchmark

A benchmark to compare the performance of different sorting algorithms in Go.

Description:

This benchmark compares the performance of different sorting algorithms in Go. Each run creates a random int slice, containing 1000 pseudo-random elements. It will then sort the slice with the specified algorithm. It currently compares the performance of the following sorting algorithms: Built-In sort package, Bubble Sort, Insertion Sort, Selection Sort, Merge Sort, Quick Sort.

Implementations

Green marks the fastest implementation, red marks the slowest

Comparison

This section compares the performance of Sorting Algorithms implementations with the functions: sort

Different Run Count

Different CPU Core Count

Bubble Sort

This benchmark uses the Bubble Sort algorithm to sort the array. Bubble Sort works by repeatedly swapping the adjacent elements, if they are in the wrong order.

Function ns/op ops/sec B/op allocs/op MB/s
sort 760726.27 1315 8192.0 1 0.0

Comparison

  • Bubble Sort sort is 738.20% slower than Builtin Sort sort.
  • Bubble Sort sort is 236.16% slower than Insertion Sort sort.
  • Bubble Sort sort is 292.95% slower than Merge Sort sort.
  • Bubble Sort sort is 978.88% slower than Quick Sort sort.
  • Bubble Sort sort is 55.05% slower than Selection Sort sort.
type BubbleSort struct{}

func (s *BubbleSort) sort(data []int) {
	n := len(data)
	for i := 0; i < n; i++ {
		for j := 0; j < n-i-1; j++ {
			if data[j] > data[j+1] {
				data[j], data[j+1] = data[j+1], data[j]
			}
		}
	}
}
Benchmark Code
func BenchmarkBubbleSort_sort(b *testing.B) {
	var s BubbleSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

Bubble Sort sort

ns/op ops/sec B/op allocs/op MB/s
760726.27 1315 8192.0 1 0.0
By Run Count
By CPU Core Count

Builtin Sort

This benchmark uses the built-in sort package to sort the array.

Function ns/op ops/sec B/op allocs/op MB/s
sort 90757.25 11019 8216.0 2 0.0

Comparison

  • Builtin Sort sort is 88.07% faster than Bubble Sort sort.
  • Builtin Sort sort is 59.90% faster than Insertion Sort sort.
  • Builtin Sort sort is 53.12% faster than Merge Sort sort.
  • Builtin Sort sort is 28.71% slower than Quick Sort sort.
  • Builtin Sort sort is 81.50% faster than Selection Sort sort.
type BuiltinSort struct{}

func (s *BuiltinSort) sort(data []int) {
	sort.Ints(data)
}
Benchmark Code
func BenchmarkBuiltinSort_sort(b *testing.B) {
	var s BuiltinSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

Builtin Sort sort

ns/op ops/sec B/op allocs/op MB/s
90757.25 11019 8216.0 2 0.0
By Run Count
By CPU Core Count

Insertion Sort

This benchmark uses the Insertion Sort algorithm to sort the array. Insertion Sort works by repeatedly inserting the next element into the sorted part of the array.

Function ns/op ops/sec B/op allocs/op MB/s
sort 226300.13 4419 8192.0 1 0.0

Comparison

  • Insertion Sort sort is 70.25% faster than Bubble Sort sort.
  • Insertion Sort sort is 149.35% slower than Builtin Sort sort.
  • Insertion Sort sort is 16.90% slower than Merge Sort sort.
  • Insertion Sort sort is 220.94% slower than Quick Sort sort.
  • Insertion Sort sort is 53.88% faster than Selection Sort sort.
type InsertionSort struct{}

func (s *InsertionSort) sort(data []int) {
	for i := 1; i < len(data); i++ {
		key := data[i]
		j := i - 1

		for j >= 0 && data[j] > key {
			data[j+1] = data[j]
			j--
		}
		data[j+1] = key
	}
}
Benchmark Code
func BenchmarkInsertionSort_sort(b *testing.B) {
	var s InsertionSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

Insertion Sort sort

ns/op ops/sec B/op allocs/op MB/s
226300.13 4419 8192.0 1 0.0
By Run Count
By CPU Core Count

Merge Sort

This benchmark uses the Merge Sort algorithm to sort the array. Merge Sort works by repeatedly splitting the array into two halves, sorting them and then merging them back together.

Function ns/op ops/sec B/op allocs/op MB/s
sort 193591.67 5166 171912.9 3005 0.0

Comparison

  • Merge Sort sort is 74.55% faster than Bubble Sort sort.
  • Merge Sort sort is 113.31% slower than Builtin Sort sort.
  • Merge Sort sort is 14.45% faster than Insertion Sort sort.
  • Merge Sort sort is 174.56% slower than Quick Sort sort.
  • Merge Sort sort is 60.54% faster than Selection Sort sort.
type MergeSort struct{}

func (s *MergeSort) sort(data []int) []int {
	if len(data) <= 1 {
		return data
	}

	// Divide the array in half
	middle := len(data) / 2
	left := s.sort(data[:middle])
	right := s.sort(data[middle:])

	return s.merge(left, right)
}

func (s *MergeSort) merge(left, right []int) []int {
	var result []int
	leftIndex, rightIndex := 0, 0

	for leftIndex < len(left) && rightIndex < len(right) {
		if left[leftIndex] < right[rightIndex] {
			result = append(result, left[leftIndex])
			leftIndex++
		} else {
			result = append(result, right[rightIndex])
			rightIndex++
		}
	}

	// Append any remaining elements
	result = append(result, left[leftIndex:]...)
	result = append(result, right[rightIndex:]...)

	return result
}
Benchmark Code
func BenchmarkMergeSort_sort(b *testing.B) {
	var s MergeSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

Merge Sort sort

ns/op ops/sec B/op allocs/op MB/s
193591.67 5166 171912.9 3005 0.0
By Run Count
By CPU Core Count

Quick Sort

This benchmark uses the Quick Sort algorithm to sort the array. Quick Sort works by repeatedly selecting a pivot element, partitioning the array around the pivot and then sorting the two partitions.

Function ns/op ops/sec B/op allocs/op MB/s
sort 70510.72 14184 8192.0 1 0.0

Comparison

  • Quick Sort sort is 90.73% faster than Bubble Sort sort.
  • Quick Sort sort is 22.31% faster than Builtin Sort sort.
  • Quick Sort sort is 68.84% faster than Insertion Sort sort.
  • Quick Sort sort is 63.58% faster than Merge Sort sort.
  • Quick Sort sort is 85.63% faster than Selection Sort sort.
type QuickSort struct{}

func (s *QuickSort) sort(data []int) {
	if len(data) < 2 {
		return
	}

	left, right := 0, len(data)-1
	pivotIndex := rand.Int() % len(data)
	data[pivotIndex], data[right] = data[right], data[pivotIndex]
	for i := range data {
		if data[i] < data[right] {
			data[i], data[left] = data[left], data[i]
			left++
		}
	}
	data[left], data[right] = data[right], data[left]
	s.sort(data[:left])
	s.sort(data[left+1:])
}
Benchmark Code
func BenchmarkQuickSort_sort(b *testing.B) {
	var s QuickSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

Quick Sort sort

ns/op ops/sec B/op allocs/op MB/s
70510.72 14184 8192.0 1 0.0
By Run Count
By CPU Core Count

Selection Sort

This benchmark uses the Selection Sort algorithm to sort the array. Selection Sort works by repeatedly selecting the smallest element from the unsorted part of the array and putting it at the end of the sorted part of the array.

Function ns/op ops/sec B/op allocs/op MB/s
sort 490634.18 2038 8192.0 1 0.0

Comparison

  • Selection Sort sort is 35.50% faster than Bubble Sort sort.
  • Selection Sort sort is 440.60% slower than Builtin Sort sort.
  • Selection Sort sort is 116.81% slower than Insertion Sort sort.
  • Selection Sort sort is 153.44% slower than Merge Sort sort.
  • Selection Sort sort is 595.83% slower than Quick Sort sort.
type SelectionSort struct{}

func (s *SelectionSort) sort(data []int) {
	n := len(data)
	for i := 0; i < n; i++ {
		minIdx := i
		for j := i + 1; j < n; j++ {
			if data[j] < data[minIdx] {
				minIdx = j
			}
		}
		data[i], data[minIdx] = data[minIdx], data[i]
	}
}
Benchmark Code
func BenchmarkSelectionSort_sort(b *testing.B) {
	var s SelectionSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

Selection Sort sort

ns/op ops/sec B/op allocs/op MB/s
490634.18 2038 8192.0 1 0.0
By Run Count
By CPU Core Count

Full Benchmark Code

type BuiltinSort struct{}

func (s *BuiltinSort) sort(data []int) {
	sort.Ints(data)
}

func BenchmarkBuiltinSort_sort(b *testing.B) {
	var s BuiltinSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

type BubbleSort struct{}

func (s *BubbleSort) sort(data []int) {
	n := len(data)
	for i := 0; i < n; i++ {
		for j := 0; j < n-i-1; j++ {
			if data[j] > data[j+1] {
				data[j], data[j+1] = data[j+1], data[j]
			}
		}
	}
}

func BenchmarkBubbleSort_sort(b *testing.B) {
	var s BubbleSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

type InsertionSort struct{}

func (s *InsertionSort) sort(data []int) {
	for i := 1; i < len(data); i++ {
		key := data[i]
		j := i - 1

		for j >= 0 && data[j] > key {
			data[j+1] = data[j]
			j--
		}
		data[j+1] = key
	}
}

func BenchmarkInsertionSort_sort(b *testing.B) {
	var s InsertionSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

type SelectionSort struct{}

func (s *SelectionSort) sort(data []int) {
	n := len(data)
	for i := 0; i < n; i++ {
		minIdx := i
		for j := i + 1; j < n; j++ {
			if data[j] < data[minIdx] {
				minIdx = j
			}
		}
		data[i], data[minIdx] = data[minIdx], data[i]
	}
}

func BenchmarkSelectionSort_sort(b *testing.B) {
	var s SelectionSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

type QuickSort struct{}

func (s *QuickSort) sort(data []int) {
	if len(data) < 2 {
		return
	}

	left, right := 0, len(data)-1
	pivotIndex := rand.Int() % len(data)
	data[pivotIndex], data[right] = data[right], data[pivotIndex]
	for i := range data {
		if data[i] < data[right] {
			data[i], data[left] = data[left], data[i]
			left++
		}
	}
	data[left], data[right] = data[right], data[left]
	s.sort(data[:left])
	s.sort(data[left+1:])
}

func BenchmarkQuickSort_sort(b *testing.B) {
	var s QuickSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

type MergeSort struct{}

func (s *MergeSort) sort(data []int) []int {
	if len(data) <= 1 {
		return data
	}

	// Divide the array in half
	middle := len(data) / 2
	left := s.sort(data[:middle])
	right := s.sort(data[middle:])

	return s.merge(left, right)
}

func (s *MergeSort) merge(left, right []int) []int {
	var result []int
	leftIndex, rightIndex := 0, 0

	for leftIndex < len(left) && rightIndex < len(right) {
		if left[leftIndex] < right[rightIndex] {
			result = append(result, left[leftIndex])
			leftIndex++
		} else {
			result = append(result, right[rightIndex])
			rightIndex++
		}
	}

	// Append any remaining elements
	result = append(result, left[leftIndex:]...)
	result = append(result, right[rightIndex:]...)

	return result
}

func BenchmarkMergeSort_sort(b *testing.B) {
	var s MergeSort
	for i := 0; i < b.N; i++ {
		data := rand.Perm(1000)
		s.sort(data)
	}
}

Full Benchmark Output

Implementation Function Runs CPU Core Count ns/op ops/sec B/op allocs/op MB/s
Bubble Sort sort 1000 2 771800 1295.672454003628 8192 1 0
Bubble Sort sort 2000 2 756872 1321.2273673751968 8192 1 0
Bubble Sort sort 3000 2 764260 1308.4552377463167 8192 1 0
Bubble Sort sort 4000 2 761273 1313.5892117545218 8192 1 0
Bubble Sort sort 5000 2 763081 1310.4768694280162 8192 1 0
Bubble Sort sort 6000 2 763987 1308.922795806735 8192 1 0
Bubble Sort sort 7000 2 757119 1320.7963345260125 8192 1 0
Bubble Sort sort 8000 2 756983 1321.0336295531076 8192 1 0
Bubble Sort sort 9000 2 760511 1314.905372834844 8192 1 0
Bubble Sort sort 10000 2 759061 1317.4171772756076 8192 1 0
Bubble Sort sort 1000 8 761510 1313.1803915903927 8192 1 0
Bubble Sort sort 2000 8 762480 1311.5098100933794 8192 1 0
Bubble Sort sort 3000 8 761322 1313.5046668820814 8192 1 0
Bubble Sort sort 4000 8 757324 1320.4388082247492 8192 1 0
Bubble Sort sort 5000 8 757838 1319.5432269165706 8192 1 0
Bubble Sort sort 6000 8 757494 1320.1424697753382 8192 1 0
Bubble Sort sort 7000 8 755060 1324.3980610812387 8192 1 0
Bubble Sort sort 8000 8 759125 1317.3061090070805 8192 1 0
Bubble Sort sort 9000 8 759221 1317.139541714468 8192 1 0
Bubble Sort sort 10000 8 755010 1324.4857684004185 8192 1 0
Bubble Sort sort 1000 16 792693 1261.5224304995754 8192 1 0
Bubble Sort sort 2000 16 764769 1307.5843816891113 8192 1 0
Bubble Sort sort 3000 16 758737 1317.9797479231934 8192 1 0
Bubble Sort sort 4000 16 762210 1311.974390259902 8192 1 0
Bubble Sort sort 5000 16 759422 1316.7909278372235 8192 1 0
Bubble Sort sort 6000 16 758206 1318.902778400593 8192 1 0
Bubble Sort sort 7000 16 761398 1313.3735575874903 8192 1 0
Bubble Sort sort 8000 16 761503 1313.1924628005404 8192 1 0
Bubble Sort sort 9000 16 757753 1319.6912450363113 8192 1 0
Bubble Sort sort 10000 16 758403 1318.5601850203652 8192 1 0
Bubble Sort sort 1000 32 765165 1306.9076604392517 8192 1 0
Bubble Sort sort 2000 32 760428 1315.048893517861 8192 1 0
Bubble Sort sort 3000 32 761388 1313.3908073150615 8192 1 0
Bubble Sort sort 4000 32 760780 1314.440442703541 8192 1 0
Bubble Sort sort 5000 32 760961 1314.1277936714234 8192 1 0
Bubble Sort sort 6000 32 762587 1311.3257897131737 8192 1 0
Bubble Sort sort 7000 32 758600 1318.2177695755338 8192 1 0
Bubble Sort sort 8000 32 761165 1313.7755939907904 8192 1 0
Bubble Sort sort 9000 32 755048 1324.4191097784512 8192 1 0
Bubble Sort sort 10000 32 760129 1315.566173636317 8192 1 0
Bubble Sort sort 1000 4 758040 1319.1915993878952 8192 1 0
Bubble Sort sort 2000 4 765934 1305.5955212851238 8192 1 0
Bubble Sort sort 3000 4 754852 1324.762999899318 8192 1 0
Bubble Sort sort 4000 4 755429 1323.7511400806693 8192 1 0
Bubble Sort sort 5000 4 762587 1311.3257897131737 8192 1 0
Bubble Sort sort 6000 4 762006 1312.3256247326137 8192 1 0
Bubble Sort sort 7000 4 757545 1320.0535941759235 8192 1 0
Bubble Sort sort 8000 4 759351 1316.9140489707659 8192 1 0
Bubble Sort sort 9000 4 762155 1312.0690673157035 8192 1 0
Bubble Sort sort 10000 4 755270 1324.0298171514823 8192 1 0
Bubble Sort sort 1000 1 765001 1307.187833741394 8192 1 0
Bubble Sort sort 2000 1 768417 1301.3767264388998 8192 1 0
Bubble Sort sort 3000 1 768165 1301.803648955628 8192 1 0
Bubble Sort sort 4000 1 761400 1313.370107696349 8192 1 0
Bubble Sort sort 5000 1 755039 1324.4348967404333 8192 1 0
Bubble Sort sort 6000 1 754419 1325.5233497565675 8192 1 0
Bubble Sort sort 7000 1 760197 1315.4484955873281 8192 1 0
Bubble Sort sort 8000 1 766906 1303.9407697944728 8192 1 0
Bubble Sort sort 9000 1 753020 1327.9859764680884 8192 1 0
Bubble Sort sort 10000 1 755167 1324.2104064399 8192 1 0
Builtin Sort sort 1000 4 90808 11012.245617126244 8216 2 0
Builtin Sort sort 2000 4 91879 10883.879885501583 8216 2 0
Builtin Sort sort 3000 4 90103 11098.40959790462 8216 2 0
Builtin Sort sort 4000 4 91050 10982.976386600769 8216 2 0
Builtin Sort sort 5000 4 90351 11067.946121238281 8216 2 0
Builtin Sort sort 6000 4 90468 11053.632223548659 8216 2 0
Builtin Sort sort 7000 4 90710 11024.142872891633 8216 2 0
Builtin Sort sort 8000 4 90679 11027.911644371905 8216 2 0
Builtin Sort sort 9000 4 90590 11038.745998454575 8216 2 0
Builtin Sort sort 10000 4 90988 10990.460280476545 8216 2 0
Builtin Sort sort 1000 2 92309 10833.17986328527 8216 2 0
Builtin Sort sort 2000 2 91952 10875.239255263616 8216 2 0
Builtin Sort sort 3000 2 91157 10970.084579352108 8216 2 0
Builtin Sort sort 4000 2 90715 11023.535247753955 8216 2 0
Builtin Sort sort 5000 2 90115 11096.931698385397 8216 2 0
Builtin Sort sort 6000 2 90547 11043.988205020598 8216 2 0
Builtin Sort sort 7000 2 90813 11011.639302742999 8216 2 0
Builtin Sort sort 8000 2 90881 11003.40005061564 8216 2 0
Builtin Sort sort 9000 2 90927 10997.833426814917 8216 2 0
Builtin Sort sort 10000 2 90821 11010.669338589092 8216 2 0
Builtin Sort sort 1000 16 90151 11092.500360506261 8216 2 0
Builtin Sort sort 2000 16 89996 11111.604960220455 8216 2 0
Builtin Sort sort 3000 16 90491 11050.822733752528 8216 2 0
Builtin Sort sort 4000 16 91024 10986.113552469678 8216 2 0
Builtin Sort sort 5000 16 91340 10948.105977665864 8216 2 0
Builtin Sort sort 6000 16 90676 11028.276500948432 8216 2 0
Builtin Sort sort 7000 16 90121 11096.192896217308 8216 2 0
Builtin Sort sort 8000 16 90375 11065.006915629323 8216 2 0
Builtin Sort sort 9000 16 90486 11051.433370908208 8216 2 0
Builtin Sort sort 10000 16 90605 11036.918492356934 8216 2 0
Builtin Sort sort 1000 1 90470 11053.387863380127 8216 2 0
Builtin Sort sort 2000 1 95212 10502.877788514053 8216 2 0
Builtin Sort sort 3000 1 89765 11140.199409569432 8216 2 0
Builtin Sort sort 4000 1 89822 11133.129968159248 8216 2 0
Builtin Sort sort 5000 1 90011 11109.753252380264 8216 2 0
Builtin Sort sort 6000 1 90691 11026.452459450222 8216 2 0
Builtin Sort sort 7000 1 91522 10926.334651777715 8216 2 0
Builtin Sort sort 8000 1 90066 11102.968933892924 8216 2 0
Builtin Sort sort 9000 1 91795 10893.839533743669 8216 2 0
Builtin Sort sort 10000 1 91208 10963.950530655206 8216 2 0
Builtin Sort sort 1000 8 90748 11019.526601137215 8216 2 0
Builtin Sort sort 2000 8 90921 10998.559188746274 8216 2 0
Builtin Sort sort 3000 8 91341 10947.986117953602 8216 2 0
Builtin Sort sort 4000 8 90193 11087.33493730112 8216 2 0
Builtin Sort sort 5000 8 91296 10953.382404486505 8216 2 0
Builtin Sort sort 6000 8 91333 10948.945069142588 8216 2 0
Builtin Sort sort 7000 8 90531 11045.94006472921 8216 2 0
Builtin Sort sort 8000 8 90715 11023.535247753955 8216 2 0
Builtin Sort sort 9000 8 89753 11141.688857196974 8216 2 0
Builtin Sort sort 10000 8 90478 11052.410530736754 8216 2 0
Builtin Sort sort 1000 32 90027 11107.778777477868 8216 2 0
Builtin Sort sort 2000 32 89780 11138.338159946536 8216 2 0
Builtin Sort sort 3000 32 90426 11058.766284033352 8216 2 0
Builtin Sort sort 4000 32 91208 10963.950530655206 8216 2 0
Builtin Sort sort 5000 32 90887 11002.673649696877 8216 2 0
Builtin Sort sort 6000 32 90165 11090.778018077968 8216 2 0
Builtin Sort sort 7000 32 89888 11124.955500177999 8216 2 0
Builtin Sort sort 8000 32 90256 11079.59581634462 8216 2 0
Builtin Sort sort 9000 32 90903 11000.73704938231 8216 2 0
Builtin Sort sort 10000 32 90896 11001.58422812885 8216 2 0
Insertion Sort sort 1000 1 225937 4426.012561023648 8192 1 0
Insertion Sort sort 2000 1 225653 4431.583005765489 8192 1 0
Insertion Sort sort 3000 1 227458 4396.416041642853 8192 1 0
Insertion Sort sort 4000 1 228389 4378.494585991444 8192 1 0
Insertion Sort sort 5000 1 224706 4450.259450125943 8192 1 0
Insertion Sort sort 6000 1 227830 4389.237589430716 8192 1 0
Insertion Sort sort 7000 1 225298 4438.565810615274 8192 1 0
Insertion Sort sort 8000 1 225140 4441.680731988985 8192 1 0
Insertion Sort sort 9000 1 226327 4418.3857869366 8192 1 0
Insertion Sort sort 10000 1 226101 4422.802199017254 8192 1 0
Insertion Sort sort 1000 2 226556 4413.919737283497 8192 1 0
Insertion Sort sort 2000 2 229678 4353.921577164552 8192 1 0
Insertion Sort sort 3000 2 227140 4402.57110152329 8192 1 0
Insertion Sort sort 4000 2 225914 4426.463167399984 8192 1 0
Insertion Sort sort 5000 2 226263 4419.635556851982 8192 1 0
Insertion Sort sort 6000 2 226583 4413.393767405321 8192 1 0
Insertion Sort sort 7000 2 226079 4423.2325868391135 8192 1 0
Insertion Sort sort 8000 2 225365 4437.246244980365 8192 1 0
Insertion Sort sort 9000 2 225696 4430.738692754856 8192 1 0
Insertion Sort sort 10000 2 226218 4420.5147247345485 8192 1 0
Insertion Sort sort 1000 32 225924 4426.267240310901 8192 1 0
Insertion Sort sort 2000 32 227249 4400.459407962191 8192 1 0
Insertion Sort sort 3000 32 225172 4441.049508819924 8192 1 0
Insertion Sort sort 4000 32 226416 4416.649000070666 8192 1 0
Insertion Sort sort 5000 32 225586 4432.899204737882 8192 1 0
Insertion Sort sort 6000 32 226751 4410.1238803798 8192 1 0
Insertion Sort sort 7000 32 226914 4406.95593925452 8192 1 0
Insertion Sort sort 8000 32 225198 4440.53677208501 8192 1 0
Insertion Sort sort 9000 32 225985 4425.072460561541 8192 1 0
Insertion Sort sort 10000 32 225683 4430.993916245353 8192 1 0
Insertion Sort sort 1000 16 227727 4391.2228238197495 8192 1 0
Insertion Sort sort 2000 16 226382 4417.312330485639 8192 1 0
Insertion Sort sort 3000 16 225684 4430.974282625264 8192 1 0
Insertion Sort sort 4000 16 225524 4434.117876589631 8192 1 0
Insertion Sort sort 5000 16 225977 4425.229116237493 8192 1 0
Insertion Sort sort 6000 16 226977 4405.73273944056 8192 1 0
Insertion Sort sort 7000 16 225890 4426.933463190048 8192 1 0
Insertion Sort sort 8000 16 225102 4442.430542598467 8192 1 0
Insertion Sort sort 9000 16 225481 4434.963478075758 8192 1 0
Insertion Sort sort 10000 16 225710 4430.463869567144 8192 1 0
Insertion Sort sort 1000 4 229004 4366.735952210442 8192 1 0
Insertion Sort sort 2000 4 226606 4412.945817851249 8192 1 0
Insertion Sort sort 3000 4 226309 4418.737213279189 8192 1 0
Insertion Sort sort 4000 4 225515 4434.2948362636635 8192 1 0
Insertion Sort sort 5000 4 226003 4424.7200258403645 8192 1 0
Insertion Sort sort 6000 4 226833 4408.529623114802 8192 1 0
Insertion Sort sort 7000 4 226101 4422.802199017254 8192 1 0
Insertion Sort sort 8000 4 224473 4454.878760474534 8192 1 0
Insertion Sort sort 9000 4 227274 4399.975360137983 8192 1 0
Insertion Sort sort 10000 4 227527 4395.082781384187 8192 1 0
Insertion Sort sort 1000 8 225094 4442.588429722694 8192 1 0
Insertion Sort sort 2000 8 227649 4392.727400515706 8192 1 0
Insertion Sort sort 3000 8 227123 4402.90063093566 8192 1 0
Insertion Sort sort 4000 8 225215 4440.201585151965 8192 1 0
Insertion Sort sort 5000 8 225664 4431.366988088485 8192 1 0
Insertion Sort sort 6000 8 228211 4381.909723895868 8192 1 0
Insertion Sort sort 7000 8 226311 4418.698163147174 8192 1 0
Insertion Sort sort 8000 8 225061 4443.239832756452 8192 1 0
Insertion Sort sort 9000 8 226747 4410.201678522759 8192 1 0
Insertion Sort sort 10000 8 225625 4432.13296398892 8192 1 0
Merge Sort sort 1000 2 196688 5084.194256894168 171912 3004 0
Merge Sort sort 2000 2 199176 5020.6852231192515 171912 3004 0
Merge Sort sort 3000 2 194666 5137.0038938489515 171911 3004 0
Merge Sort sort 4000 2 193610 5165.022467847735 171913 3005 0
Merge Sort sort 5000 2 190229 5256.822040803453 171915 3005 0
Merge Sort sort 6000 2 192231 5202.074587345433 171912 3004 0
Merge Sort sort 7000 2 192059 5206.733347565071 171913 3005 0
Merge Sort sort 8000 2 192131 5204.782153842951 171913 3005 0
Merge Sort sort 9000 2 192407 5197.316105962881 171913 3005 0
Merge Sort sort 10000 2 194330 5145.885864251531 171912 3004 0
Merge Sort sort 1000 32 191102 5232.807610595389 171916 3005 0
Merge Sort sort 2000 32 193525 5167.29104766826 171915 3005 0
Merge Sort sort 3000 32 196646 5085.280148083358 171913 3005 0
Merge Sort sort 4000 32 191011 5235.3005847830755 171913 3005 0
Merge Sort sort 5000 32 191208 5229.9066984645 171914 3005 0
Merge Sort sort 6000 32 191239 5229.05892626504 171914 3005 0
Merge Sort sort 7000 32 191828 5213.003315470109 171913 3005 0
Merge Sort sort 8000 32 192448 5196.208846025939 171914 3005 0
Merge Sort sort 9000 32 191645 5217.981163088001 171913 3004 0
Merge Sort sort 10000 32 192014 5207.9535867176355 171914 3005 0
Merge Sort sort 1000 16 193175 5176.653293645658 171915 3005 0
Merge Sort sort 2000 16 201147 4971.48851337579 171914 3005 0
Merge Sort sort 3000 16 191276 5228.047428846275 171914 3005 0
Merge Sort sort 4000 16 192572 5192.862929190121 171915 3005 0
Merge Sort sort 5000 16 190800 5241.090146750524 171914 3005 0
Merge Sort sort 6000 16 190726 5243.123643341757 171913 3005 0
Merge Sort sort 7000 16 191311 5227.0909670640995 171913 3005 0
Merge Sort sort 8000 16 190805 5240.952805219989 171913 3004 0
Merge Sort sort 9000 16 191787 5214.117745206922 171914 3005 0
Merge Sort sort 10000 16 190577 5247.222907276324 171914 3005 0
Merge Sort sort 1000 1 193662 5163.635612562092 171911 3004 0
Merge Sort sort 2000 1 199459 5013.561684356184 171913 3005 0
Merge Sort sort 3000 1 194793 5133.65470011756 171911 3004 0
Merge Sort sort 4000 1 190606 5246.424561661228 171911 3004 0
Merge Sort sort 5000 1 190404 5251.990504401168 171912 3005 0
Merge Sort sort 6000 1 190465 5250.308455621768 171911 3004 0
Merge Sort sort 7000 1 192743 5188.2558640261905 171912 3005 0
Merge Sort sort 8000 1 196261 5095.255807317806 171912 3004 0
Merge Sort sort 9000 1 196062 5100.427415817446 171911 3004 0
Merge Sort sort 10000 1 192988 5181.669326590254 171913 3005 0
Merge Sort sort 1000 4 201349 4966.500951084932 171911 3004 0
Merge Sort sort 2000 4 197092 5073.772654394902 171912 3004 0
Merge Sort sort 3000 4 194434 5143.133402594197 171912 3004 0
Merge Sort sort 4000 4 194178 5149.913996436259 171911 3004 0
Merge Sort sort 5000 4 193583 5165.742859651932 171913 3005 0
Merge Sort sort 6000 4 193707 5162.436050323427 171912 3004 0
Merge Sort sort 7000 4 191675 5217.164471109952 171913 3005 0
Merge Sort sort 8000 4 193847 5158.707640561886 171912 3004 0
Merge Sort sort 9000 4 192669 5190.2485610035865 171911 3004 0
Merge Sort sort 10000 4 193836 5159.00039208403 171912 3004 0
Merge Sort sort 1000 8 196450 5090.353779587681 171914 3005 0
Merge Sort sort 2000 8 200295 4992.635862103398 171912 3004 0
Merge Sort sort 3000 8 197233 5070.145462473319 171915 3005 0
Merge Sort sort 4000 8 192848 5185.431013025803 171914 3005 0
Merge Sort sort 5000 8 193718 5162.142908764286 171915 3005 0
Merge Sort sort 6000 8 192581 5192.620248103395 171911 3004 0
Merge Sort sort 7000 8 193179 5176.546104907883 171913 3005 0
Merge Sort sort 8000 8 193885 5157.696572710627 171913 3004 0
Merge Sort sort 9000 8 194007 5154.453189833356 171914 3005 0
Merge Sort sort 10000 8 193122 5178.073963608496 171913 3005 0
Quick Sort sort 1000 2 72674 13760.079258056527 8192 1 0
Quick Sort sort 2000 2 70190 14247.043738424278 8192 1 0
Quick Sort sort 3000 2 70705 14143.271338660632 8192 1 0
Quick Sort sort 4000 2 71070 14070.634585619811 8192 1 0
Quick Sort sort 5000 2 71375 14010.507880910684 8192 1 0
Quick Sort sort 6000 2 69828 14320.902789711863 8192 1 0
Quick Sort sort 7000 2 70828 14118.710114643925 8192 1 0
Quick Sort sort 8000 2 70680 14148.27391058291 8192 1 0
Quick Sort sort 9000 2 69901 14305.946982160483 8192 1 0
Quick Sort sort 10000 2 69579 14372.152517282513 8192 1 0
Quick Sort sort 1000 1 72034 13882.333342588223 8192 1 0
Quick Sort sort 2000 1 69616 14364.51390484946 8192 1 0
Quick Sort sort 3000 1 71881 13911.882138534522 8192 1 0
Quick Sort sort 4000 1 71108 14063.115261292682 8192 1 0
Quick Sort sort 5000 1 69808 14325.005730002293 8192 1 0
Quick Sort sort 6000 1 69299 14430.222658335619 8192 1 0
Quick Sort sort 7000 1 69852 14315.982362709728 8192 1 0
Quick Sort sort 8000 1 70880 14108.352144469525 8192 1 0
Quick Sort sort 9000 1 69257 14438.973677750986 8192 1 0
Quick Sort sort 10000 1 69354 14418.779017792773 8192 1 0
Quick Sort sort 1000 16 71926 13903.178266551733 8192 1 0
Quick Sort sort 2000 16 70971 14090.26221977991 8192 1 0
Quick Sort sort 3000 16 71690 13948.946854512484 8192 1 0
Quick Sort sort 4000 16 70728 14138.672095916752 8192 1 0
Quick Sort sort 5000 16 70626 14159.091552685979 8192 1 0
Quick Sort sort 6000 16 70144 14256.38686131387 8192 1 0
Quick Sort sort 7000 16 70456 14193.255365050529 8192 1 0
Quick Sort sort 8000 16 70145 14256.18361964502 8192 1 0
Quick Sort sort 9000 16 69664 14354.616444648598 8192 1 0
Quick Sort sort 10000 16 69992 14287.347125385759 8192 1 0
Quick Sort sort 1000 32 72402 13811.773155437695 8192 1 0
Quick Sort sort 2000 32 70951 14094.234048850616 8192 1 0
Quick Sort sort 3000 32 70778 14128.684054367177 8192 1 0
Quick Sort sort 4000 32 70206 14243.796826482067 8192 1 0
Quick Sort sort 5000 32 70316 14221.514306843394 8192 1 0
Quick Sort sort 6000 32 70435 14197.487044793072 8192 1 0
Quick Sort sort 7000 32 69620 14363.688595231255 8192 1 0
Quick Sort sort 8000 32 70088 14267.777650953087 8192 1 0
Quick Sort sort 9000 32 69695 14348.231580457708 8192 1 0
Quick Sort sort 10000 32 70576 14169.12264792564 8192 1 0
Quick Sort sort 1000 4 72551 13783.407534010557 8192 1 0
Quick Sort sort 2000 4 71208 14043.365913942254 8192 1 0
Quick Sort sort 3000 4 71251 14034.890738375601 8192 1 0
Quick Sort sort 4000 4 69542 14379.799258002358 8192 1 0
Quick Sort sort 5000 4 71083 14068.061280474938 8192 1 0
Quick Sort sort 6000 4 70907 14102.979959665478 8192 1 0
Quick Sort sort 7000 4 70218 14241.362613574867 8192 1 0
Quick Sort sort 8000 4 70125 14260.249554367201 8192 1 0
Quick Sort sort 9000 4 69977 14290.409706046272 8192 1 0
Quick Sort sort 10000 4 69992 14287.347125385759 8192 1 0
Quick Sort sort 1000 8 71234 14038.240166212763 8192 1 0
Quick Sort sort 2000 8 69921 14301.85495058709 8192 1 0
Quick Sort sort 3000 8 70635 14157.28746372195 8192 1 0
Quick Sort sort 4000 8 70352 14214.236979758927 8192 1 0
Quick Sort sort 5000 8 70823 14119.706874885278 8192 1 0
Quick Sort sort 6000 8 70312 14222.323358743884 8192 1 0
Quick Sort sort 7000 8 69116 14468.429885988773 8192 1 0
Quick Sort sort 8000 8 70395 14205.554371759357 8192 1 0
Quick Sort sort 9000 8 69882 14309.836581666237 8192 1 0
Quick Sort sort 10000 8 69791 14328.495078161941 8192 1 0
Selection Sort sort 1000 32 495540 2018.000565040158 8192 1 0
Selection Sort sort 2000 32 490667 2038.0420937214037 8192 1 0
Selection Sort sort 3000 32 489719 2041.9873437624433 8192 1 0
Selection Sort sort 4000 32 496502 2014.0905776814595 8192 1 0
Selection Sort sort 5000 32 485845 2058.2696127365725 8192 1 0
Selection Sort sort 6000 32 484268 2064.972288071894 8192 1 0
Selection Sort sort 7000 32 487866 2049.7431671811523 8192 1 0
Selection Sort sort 8000 32 492298 2031.2899910216981 8192 1 0
Selection Sort sort 9000 32 486018 2057.536963651552 8192 1 0
Selection Sort sort 10000 32 489627 2042.3710293754225 8192 1 0
Selection Sort sort 1000 8 495900 2016.5355918531961 8192 1 0
Selection Sort sort 2000 8 507004 1972.3710266585667 8192 1 0
Selection Sort sort 3000 8 490226 2039.8754860003346 8192 1 0
Selection Sort sort 4000 8 503468 1986.223553433386 8192 1 0
Selection Sort sort 5000 8 491211 2035.7850292440519 8192 1 0
Selection Sort sort 6000 8 493769 2025.2385224669836 8192 1 0
Selection Sort sort 7000 8 489770 2041.7747105784347 8192 1 0
Selection Sort sort 8000 8 492046 2032.330310580718 8192 1 0
Selection Sort sort 9000 8 493042 2028.2247759825734 8192 1 0
Selection Sort sort 10000 8 489649 2042.2792653513027 8192 1 0
Selection Sort sort 1000 1 482798 2071.2596158227666 8192 1 0
Selection Sort sort 2000 1 482653 2071.881869583324 8192 1 0
Selection Sort sort 3000 1 486565 2055.2238652595233 8192 1 0
Selection Sort sort 4000 1 484584 2063.6257078236176 8192 1 0
Selection Sort sort 5000 1 489139 2044.4086445775126 8192 1 0
Selection Sort sort 6000 1 487162 2052.7052602625 8192 1 0
Selection Sort sort 7000 1 484255 2065.027722997181 8192 1 0
Selection Sort sort 8000 1 485788 2058.5111200770707 8192 1 0
Selection Sort sort 9000 1 485136 2061.2776623462287 8192 1 0
Selection Sort sort 10000 1 496346 2014.7236000693065 8192 1 0
Selection Sort sort 1000 4 489108 2044.5382205974959 8192 1 0
Selection Sort sort 2000 4 488687 2046.2995741650586 8192 1 0
Selection Sort sort 3000 4 483738 2067.234742773981 8192 1 0
Selection Sort sort 4000 4 488835 2045.6800351856966 8192 1 0
Selection Sort sort 5000 4 494493 2022.2733183280652 8192 1 0
Selection Sort sort 6000 4 489224 2044.0534397331285 8192 1 0
Selection Sort sort 7000 4 487540 2051.1137547688395 8192 1 0
Selection Sort sort 8000 4 497423 2010.3614026693579 8192 1 0
Selection Sort sort 9000 4 485482 2059.808602584648 8192 1 0
Selection Sort sort 10000 4 485898 2058.045104116502 8192 1 0
Selection Sort sort 1000 2 494598 2021.844002604135 8192 1 0
Selection Sort sort 2000 2 493543 2026.1659065167573 8192 1 0
Selection Sort sort 3000 2 497646 2009.4605402233717 8192 1 0
Selection Sort sort 4000 2 493265 2027.3078365584422 8192 1 0
Selection Sort sort 5000 2 497868 2008.564519109483 8192 1 0
Selection Sort sort 6000 2 491943 2032.7558274027683 8192 1 0
Selection Sort sort 7000 2 492865 2028.9531616162642 8192 1 0
Selection Sort sort 8000 2 491389 2035.0475895878826 8192 1 0
Selection Sort sort 9000 2 489894 2041.2579047712363 8192 1 0
Selection Sort sort 10000 2 489831 2041.5204427649537 8192 1 0
Selection Sort sort 1000 16 493387 2026.8065433422446 8193 1 0
Selection Sort sort 2000 16 485843 2058.278085719049 8192 1 0
Selection Sort sort 3000 16 498245 2007.044726991741 8192 1 0
Selection Sort sort 4000 16 488055 2048.9494011945376 8192 1 0
Selection Sort sort 5000 16 489824 2041.5496178219116 8192 1 0
Selection Sort sort 6000 16 488322 2047.829096374933 8192 1 0
Selection Sort sort 7000 16 491207 2035.8016070617887 8192 1 0
Selection Sort sort 8000 16 490250 2039.775624681285 8192 1 0
Selection Sort sort 9000 16 490188 2040.0336197540535 8192 1 0
Selection Sort sort 10000 16 490599 2038.3245787292676 8192 1 0