Skip to content

Repository files navigation

Sorting Algorithms Benchmark Results

Overall Top 20 Algorithms (by average time across sizes)

RankAlgorithmsOverall Average Time
1stCubesort855us
2ndReplacement Selection Sort1ms 11us
3rdBurst Sort1ms 511us
4thBucket Sort1ms 721us
5thFlash Sort1ms 777us
6thSpreadsort2ms 224us
7thPolyphase Merge Sort2ms 515us
8thMSD Radix Sort3ms 508us
9thMSD Radix Sort In-Place3ms 801us
10thIntro Sort3ms 942us
11thPostman Sort4ms 275us
12thRadix Sort4ms 353us
13thLSD Radix Sort4ms 363us
14thMerge Insertion Sort4ms 619us
15thQuick Sort5ms 130us
16thHyper Quick5ms 268us
17thTree Sort5ms 576us
18thFranceschini's Method5ms 893us
19thMerge Sort6ms 486us
20thI Can't Believe It Can Sort6ms 613us

Skipped Algorithms

AlgorithmSkipped At Size
Bogo Sort12
Slowsort333
Bead Sort2500
Stooge Sort5000
Smooth Sort25000

Detailed Benchmark Results

This benchmark report compares various sorting algorithms based on their performance across different array sizes. Each algorithm's performance is evaluated by its average and median runtimes, as well as the variance in its runtime measurements. A low variance (typically below 10%) indicates consistent performance, whereas a high variance (often above 50%) indicates that the algorithm's performance is less predictable. Algorithms that do not meet performance criteria at certain sizes are noted accordingly.

Table of Contents

Array Size: 5

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stInsertion Sort, Exchange Sort, Merge Insertion Sort, Gnome Sort, Selection Sort, Cocktail Sort, Bubble Sort, Shell Sort, Odd-Even Sort, Spaghetti Sort, Comb Sort, Cycle Sort, Franceschini's Method, Tim Sort, Slowsort, Tree Sort, Heap Sort, Merge Sort In-Place, Intro Sort, Quick Sort, Library Sort, Strand Sort, Burst Sort, Pancake Sort, Patience Sort, I Can't Believe It Can Sort, Hyper Quick, Polyphase Merge Sort, Stooge Sort, Bucket Sort, Merge Sort, Spreadsort, Cubesort, MSD Radix Sort In-Place, MSD Radix Sort, Flash Sort, Smooth Sort, Replacement Selection Sort, Sorting Network, Tournament Sort, Sample Sort, Block Sort, Radix Sort, LSD Radix Sort, Postman Sort, Bogo Sort, Bitonic Sort Parallelless than a msless than a ms
48thCounting Sort118ms119ms250%
49thBead Sort494ms487ms210%
50thPigeonhole Sort740ms657ms214%
51stSleep Sort1s 328ms1s 373ms128%

Array Size: 7

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stInsertion Sort, Merge Insertion Sort, Cocktail Sort, Exchange Sort, Gnome Sort, Shell Sort, Bubble Sort, Selection Sort, Spaghetti Sort, Odd-Even Sort, Franceschini's Method, Tim Sort, Comb Sort, Cycle Sort, Tree Sort, Heap Sort, Patience Sort, Burst Sort, Merge Sort In-Place, Intro Sort, Library Sort, Strand Sort, Bucket Sort, Pancake Sort, Hyper Quick, I Can't Believe It Can Sort, Cubesort, Quick Sort, Polyphase Merge Sort, Spreadsort, Merge Sort, Flash Sort, Slowsort, MSD Radix Sort, MSD Radix Sort In-Place, Smooth Sort, Replacement Selection Sort, Stooge Sort, Sorting Network, Tournament Sort, Block Sort, Sample Sort, Radix Sort, LSD Radix Sort, Postman Sort, Bitonic Sort Parallelless than a msless than a ms
47thBogo Sort14ms9ms604%
48thCounting Sort143ms145ms173%
49thBead Sort784ms791ms122%
50thPigeonhole Sort909ms887ms164%
51stSleep Sort1s 493ms1s 546ms103%

Array Size: 9

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stInsertion Sort, Merge Insertion Sort, Selection Sort, Exchange Sort, Shell Sort, Odd-Even Sort, Cocktail Sort, Tim Sort, Gnome Sort, Bubble Sort, Franceschini's Method, Spaghetti Sort, Comb Sort, Intro Sort, Tree Sort, Cycle Sort, Library Sort, Heap Sort, Merge Sort In-Place, Polyphase Merge Sort, Patience Sort, Burst Sort, Strand Sort, Hyper Quick, Pancake Sort, I Can't Believe It Can Sort, Quick Sort, Bucket Sort, Flash Sort, Replacement Selection Sort, Merge Sort, Cubesort, Spreadsort, MSD Radix Sort In-Place, MSD Radix Sort, Smooth Sort, Slowsort, Stooge Sort, Block Sort, Sample Sort, Radix Sort, Tournament Sort, LSD Radix Sort, Postman Sort, Sorting Network, Bitonic Sort Parallelless than a msless than a ms
47thCounting Sort172ms172ms125%
48thPigeonhole Sort1s 17ms983ms130%
49thBead Sort1s 223ms1s 210ms143%
50thBogo Sort1s 479ms994ms923%
51stSleep Sort1s 599ms1s 639ms96%

Array Size: 12

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stInsertion Sort, Merge Insertion Sort, Spaghetti Sort, Selection Sort, Tim Sort, Shell Sort, Exchange Sort, Comb Sort, Bubble Sort, Cocktail Sort, Franceschini's Method, Odd-Even Sort, Polyphase Merge Sort, Tree Sort, Intro Sort, Gnome Sort, Burst Sort, Patience Sort, Bucket Sort, Library Sort, Strand Sort, Heap Sort, Spreadsort, Merge Sort In-Place, Replacement Selection Sort, Cycle Sort, Quick Sort, Cubesort, Hyper Quick, Flash Sort, I Can't Believe It Can Sort, Pancake Sort, Merge Sort, MSD Radix Sort, MSD Radix Sort In-Place, Smooth Sort, Sample Sort, Block Sort, Radix Sort, Tournament Sort, Sorting Network, Postman Sort, LSD Radix Sort, Slowsort, Stooge Sort, Bitonic Sort Parallelless than a msless than a ms
47thCounting Sort176ms172ms118%
48thPigeonhole Sort506ms488ms187%
49thSleep Sort1s 684ms1s 724ms62%
50thBead Sort1s 823ms1s 761ms120%
51stBogo Sort32min 50s 58ms23min 1s 595ms608%

Note: The following algorithm were removed for this array size due to performance issues: Bogo Sort (at size 12)

Array Size: 17

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stSpaghetti Sort, Insertion Sort, Tim Sort, Shell Sort, Selection Sort, Merge Insertion Sort, Exchange Sort, Franceschini's Method, Intro Sort, Tree Sort, Comb Sort, Odd-Even Sort, Patience Sort, Spreadsort, Library Sort, Strand Sort, Cubesort, Gnome Sort, Heap Sort, Flash Sort, Cocktail Sort, Merge Sort In-Place, Burst Sort, Bucket Sort, Cycle Sort, Hyper Quick, Bubble Sort, Polyphase Merge Sort, I Can't Believe It Can Sort, Replacement Selection Sort, Pancake Sort, Merge Sort, MSD Radix Sort In-Place, MSD Radix Sort, Quick Sort, Smooth Sort, Sample Sort, Block Sort, Radix Sort, LSD Radix Sort, Tournament Sort, Postman Sort, Sorting Network, Stooge Sort, Slowsort, Bitonic Sort Parallelless than a msless than a ms
47thCounting Sort171ms172ms92%
48thSleep Sort1s 779ms1s 812ms53%
49thPigeonhole Sort1s 820ms1s 587ms120%
50thBead Sort2s 406ms2s 351ms111%

Array Size: 25

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stSpaghetti Sort, Insertion Sort, Shell Sort, Merge Insertion Sort, Tim Sort, Cubesort, Selection Sort, Franceschini's Method, Replacement Selection Sort, Intro Sort, Patience Sort, Tree Sort, Spreadsort, Comb Sort, Flash Sort, Exchange Sort, Bucket Sort, Library Sort, Burst Sort, Strand Sort, Heap Sort, Merge Sort In-Place, Polyphase Merge Sort, Odd-Even Sort, Hyper Quick, Quick Sort, I Can't Believe It Can Sort, MSD Radix Sort, Gnome Sort, MSD Radix Sort In-Place, Cocktail Sort, Merge Sort, Cycle Sort, Bubble Sort, Pancake Sort, Sample Sort, Block Sort, Smooth Sort, Radix Sort, LSD Radix Sort, Tournament Sort, Sorting Network, Postman Sort, Stooge Sort, Bitonic Sort Parallel, Slowsortless than a msless than a ms
47thCounting Sort179ms183ms84%
48thSleep Sort1s 849ms1s 871ms33%
49thPigeonhole Sort1s 902ms1s 583ms128%
50thBead Sort3s 672ms3s 577ms94%

Array Size: 30

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stSpaghetti Sort, Shell Sort, Merge Insertion Sort, Insertion Sort, Franceschini's Method, Tim Sort, Intro Sort, Spreadsort, Patience Sort, Tree Sort, Flash Sort, Selection Sort, Comb Sort, Replacement Selection Sort, Cubesort, Burst Sort, Bucket Sort, Strand Sort, Polyphase Merge Sort, Library Sort, Exchange Sort, Merge Sort In-Place, Heap Sort, Hyper Quick, Odd-Even Sort, I Can't Believe It Can Sort, MSD Radix Sort, MSD Radix Sort In-Place, Quick Sort, Merge Sort, Gnome Sort, Cocktail Sort, Pancake Sort, Bubble Sort, Sample Sort, Cycle Sort, Block Sort, LSD Radix Sort, Smooth Sort, Sorting Network, Radix Sort, Tournament Sort, Postman Sort, Bitonic Sort Parallel, Slowsort, Stooge Sortless than a msless than a ms
47thCounting Sort181ms184ms83%
48thSleep Sort1s 878ms1s 896ms29%
49thPigeonhole Sort1s 937ms1s 585ms114%
50thBead Sort4s 447ms4s 291ms79%

Array Size: 41

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stSpaghetti Sort, Shell Sort, Intro Sort, Merge Insertion Sort, Cubesort, Flash Sort, Spreadsort, Replacement Selection Sort, Patience Sort, Franceschini's Method, Tree Sort, Tim Sort, Insertion Sort, Bucket Sort, Burst Sort, Comb Sort, Strand Sort, Library Sort, Polyphase Merge Sort, Merge Sort In-Place, Selection Sort, Hyper Quick, Heap Sort, MSD Radix Sort, Exchange Sort, MSD Radix Sort In-Place, I Can't Believe It Can Sort, Merge Sort, Quick Sort, Odd-Even Sort, Block Sort, Sample Sort, Pancake Sort, LSD Radix Sort, Cocktail Sort, Gnome Sort, Radix Sort, Cycle Sort, Bubble Sort, Smooth Sort, Postman Sort, Tournament Sort, Sorting Network, Bitonic Sort Parallel, Stooge Sortless than a msless than a ms
46thSlowsort4ms4ms72%
47thCounting Sort183ms188ms86%
48thSleep Sort1s 909ms1s 921ms20%
49thPigeonhole Sort1s 981ms1s 634ms114%
50thBead Sort6s 181ms6s 6ms72%

Array Size: 55

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort, Spaghetti Sort, Replacement Selection Sort, Spreadsort, Flash Sort, Shell Sort, Merge Insertion Sort, Intro Sort, Patience Sort, Franceschini's Method, Tim Sort, Tree Sort, Burst Sort, Polyphase Merge Sort, Bucket Sort, Comb Sort, Insertion Sort, Strand Sort, Hyper Quick, Merge Sort In-Place, Library Sort, MSD Radix Sort, Heap Sort, MSD Radix Sort In-Place, Selection Sort, I Can't Believe It Can Sort, Merge Sort, Quick Sort, Sample Sort, Exchange Sort, Block Sort, LSD Radix Sort, Odd-Even Sort, Pancake Sort, Radix Sort, Cocktail Sort, Gnome Sort, Postman Sort, Cycle Sort, Bubble Sort, Sorting Network, Tournament Sort, Smooth Sort, Bitonic Sort Parallelless than a msless than a ms
45thStooge Sort4ms5ms113%
46thSlowsort20ms18ms75%
47thCounting Sort185ms190ms71%
48thSleep Sort1s 936ms1s 945ms16%
49thPigeonhole Sort2s 7ms1s 609ms125%
50thBead Sort8s 401ms8s 238ms74%

Array Size: 75

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stReplacement Selection Sort, Flash Sort, Spreadsort, Cubesort, Intro Sort, Shell Sort, Patience Sort, Spaghetti Sort, Merge Insertion Sort, Bucket Sort, Burst Sort, Franceschini's Method, Tree Sort, Tim Sort, Polyphase Merge Sort, Comb Sort, Hyper Quick, MSD Radix Sort, Merge Sort In-Place, MSD Radix Sort In-Place, Heap Sort, Library Sort, Strand Sort, I Can't Believe It Can Sort, Insertion Sort, Merge Sort, Quick Sort, Selection Sort, Sample Sort, LSD Radix Sort, Block Sort, Radix Sort, Exchange Sort, Postman Sort, Odd-Even Sort, Pancake Sort, Cocktail Sort, Gnome Sort, Tournament Sort, Bubble Sort, Cycle Sort, Sorting Network, Smooth Sort, Bitonic Sort Parallelless than a msless than a ms
45thStooge Sort14ms15ms103%
46thSlowsort117ms116ms67%
47thCounting Sort186ms192ms66%
48thSleep Sort1s 954ms1s 962ms12%
49thPigeonhole Sort2s 30ms1s 654ms123%
50thBead Sort11s 524ms11s 589ms67%

Array Size: 100

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort, Replacement Selection Sort, Flash Sort, Intro Sort, Spreadsort, Patience Sort, Merge Insertion Sort, Shell Sort, Burst Sort, Bucket Sort, Franceschini's Method, Tree Sort, Tim Sort, Polyphase Merge Sort, Comb Sort, Spaghetti Sort, MSD Radix Sort, Hyper Quick, MSD Radix Sort In-Place, Merge Sort In-Place, Heap Sort, I Can't Believe It Can Sort, Merge Sort, Library Sort, Strand Sort, Quick Sort, LSD Radix Sort, Block Sort, Insertion Sort, Sample Sort, Radix Sort, Selection Sort, Postman Sort, Exchange Sort, Odd-Even Sort, Pancake Sort, Tournament Sort, Cocktail Sort, Gnome Sort, Bubble Sort, Sorting Network, Cycle Sort, Smooth Sort, Bitonic Sort Parallelless than a msless than a ms
45thStooge Sort41ms44ms81%
46thCounting Sort188ms194ms83%
47thSlowsort581ms563ms55%
48thSleep Sort1s 968ms1s 974ms9%
49thPigeonhole Sort2s 48ms1s 652ms109%
50thBead Sort15s 619ms16s 701ms103%

Array Size: 136

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stReplacement Selection Sort, Cubesort, Flash Sort, Intro Sort, Burst Sort, Patience Sort, Bucket Sort, Spreadsort, Shell Sort, Merge Insertion Sort, Franceschini's Method, Tree Sort, Tim Sort, MSD Radix Sort, Polyphase Merge Sort, Hyper Quick, MSD Radix Sort In-Place, Comb Sort, Merge Sort In-Place, Heap Sort, I Can't Believe It Can Sort, Merge Sort, LSD Radix Sort, Spaghetti Sort, Strand Sort, Quick Sort, Sample Sort, Block Sort, Library Sort, Radix Sort, Postman Sort, Insertion Sort, Selection Sort, Exchange Sort, Pancake Sort, Odd-Even Sort, Cocktail Sort, Bubble Sort, Tournament Sort, Gnome Sort, Cycle Sort, Sorting Network, Smooth Sort, Bitonic Sort Parallelless than a msless than a ms
45thStooge Sort40ms41ms77%
46thCounting Sort189ms197ms73%
47thSleep Sort1s 982ms1s 987ms8%
48thPigeonhole Sort2s 79ms1s 668ms110%
49thSlowsort3s 494ms3s 197ms46%
50thBead Sort21s 186ms21s 775ms59%

Array Size: 183

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort, Replacement Selection Sort, Flash Sort, Burst Sort, Bucket Sort, Intro Sort, Shell Sort, Spreadsort, Patience Sort, Merge Insertion Sort, Franceschini's Method, Polyphase Merge Sort, MSD Radix Sort, Tree Sort, Hyper Quick, MSD Radix Sort In-Place, Tim Sort, I Can't Believe It Can Sort, LSD Radix Sort, Comb Sort, Quick Sort, Merge Sort In-Place, Heap Sort, Merge Sort, Radix Sort, Block Sort, Sample Sort, Postman Sort, Spaghetti Sort, Strand Sort, Library Sort, Insertion Sort, Selection Sort, Exchange Sort, Pancake Sort, Odd-Even Sort, Sorting Network, Bubble Sort, Cocktail Sort, Tournament Sort, Bitonic Sort Parallel, Cycle Sort, Gnome Sort, Smooth Sortless than a msless than a ms
45thStooge Sort140ms140ms67%
46thCounting Sort243ms239ms90%
47thSleep Sort1s 994ms1s 997ms6%
48thPigeonhole Sort2s 661ms2s 711ms92%
49thSlowsort27s 469ms26s 848ms19%
50thBead Sort29s 873ms32s 243ms82%

Array Size: 250

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stReplacement Selection Sort, Cubesort, Burst Sort, Flash Sort, Bucket Sort, Shell Sort, Spreadsort, Polyphase Merge Sort, Intro Sort, Patience Sort, Merge Insertion Sort, Franceschini's Method, Comb Sort, Tree Sort, MSD Radix Sort In-Place, MSD Radix Sort, Hyper Quick, Tim Sort, Quick Sort, Radix Sort, I Can't Believe It Can Sort, LSD Radix Sort, Merge Sort, Merge Sort In-Place, Heap Sort, Postman Sort, Block Sort, Sample Sort, Strand Sort, Spaghetti Sort, Library Sort, Sorting Network, Selection Sort, Insertion Sort, Bitonic Sort Parallel, Exchange Sort, Cocktail Sort, Pancake Sort, Bubble Sort, Odd-Even Sort, Tournament Sortless than a msless than a ms
42ndCycle Sort, Gnome Sort, Smooth Sort4ms4ms
45thCounting Sort235ms237ms50%
46thStooge Sort417ms419ms34%
47thSleep Sort2s 8ms2s 9ms4%
48thPigeonhole Sort2s 711ms2s 719ms91%
49thBead Sort46s 971ms46s 857ms49%
50thSlowsort3min 52s 379ms3min 47s 804ms22%

Array Size: 333

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stReplacement Selection Sort, Cubesort, Flash Sort, Burst Sort, Bucket Sort, Spreadsort, Polyphase Merge Sort, Intro Sort, Merge Insertion Sort, Patience Sort, Tree Sort, Shell Sort, MSD Radix Sort, MSD Radix Sort In-Place, Franceschini's Method, Comb Sort, Hyper Quick, Tim Sort, LSD Radix Sort, I Can't Believe It Can Sort, Merge Sort, Quick Sort, Block Sort, Heap Sort, Radix Sort, Merge Sort In-Place, Postman Sort, Strand Sort, Sample Sort, Spaghetti Sort, Library Sortless than a msless than a ms
32ndInsertion Sort, Selection Sort, Sorting Network, Bitonic Sort Parallel, Exchange Sort, Pancake Sort, Cocktail Sort, Tournament Sort, Bubble Sort, Odd-Even Sort2ms3ms
42ndGnome Sort, Cycle Sort, Smooth Sort7ms8ms
45thCounting Sort218ms240ms85%
46thStooge Sort1s 116ms1s 143ms34%
47thSleep Sort2s 22ms2s 22ms6%
48thPigeonhole Sort2s 25ms1s 612ms127%
49thBead Sort55s 301ms58s 284ms65%
50thSlowsort28min 1s 588ms28min 33s 583ms70%

Note: The following algorithm were removed for this array size due to performance issues: Slowsort (at size 333)

Array Size: 500

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stReplacement Selection Sort, Cubesort, Bucket Sort, Burst Sort, Spreadsort, Flash Sort, Polyphase Merge Sort, Intro Sort, Merge Insertion Sort, Tree Sort, Patience Sort, MSD Radix Sort, Shell Sort, MSD Radix Sort In-Place, Tim Sort, Franceschini's Method, Comb Sort, Quick Sort, Hyper Quick, Postman Sort, LSD Radix Sort, Radix Sort, I Can't Believe It Can Sort, Merge Sort, Block Sort, Heap Sort, Merge Sort In-Place, Sample Sort, Strand Sort, Spaghetti Sortless than a msless than a ms
31stSorting Network, Library Sort, Bitonic Sort Parallel3ms3ms
34thInsertion Sort, Selection Sort6ms6ms
36thPancake Sort, Tournament Sort, Exchange Sort9ms9ms
39thCocktail Sort, Bubble Sort11ms11ms
41stOdd-Even Sort13ms13ms61%
42ndGnome Sort17ms17ms73%
43rdSmooth Sort, Cycle Sort19ms18ms
45thCounting Sort210ms210ms49%
46thPigeonhole Sort1s 409ms1s 419ms78%
47thSleep Sort2s 57ms2s 58ms6%
48thStooge Sort3s 106ms3s 99ms21%
49thBead Sort1min 13s 457ms1min 15s 614ms34%

Array Size: 750

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stReplacement Selection Sort, Cubesort, Spreadsort, Burst Sort, Flash Sort, Bucket Sort, Polyphase Merge Sort, Intro Sort, Merge Insertion Sort, Franceschini's Method, Patience Sort, Tree Sort, MSD Radix Sort, MSD Radix Sort In-Place, Hyper Quick, Shell Sort, Tim Sort, Quick Sort, LSD Radix Sort, Radix Sort, Comb Sort, I Can't Believe It Can Sort, Postman Sort, Merge Sort, Heap Sort, Block Sort, Sample Sort, Merge Sort In-Place, Strand Sortless than a msless than a ms
30thSpaghetti Sort5ms6ms283%
31stSorting Network, Library Sort9ms9ms
33rdInsertion Sort17ms18ms199%
34thSelection Sort18ms18ms263%
35thTournament Sort, Pancake Sort, Exchange Sort24ms25ms
38thCocktail Sort32ms34ms148%
39thBubble Sort34ms36ms209%
40thOdd-Even Sort39ms39ms177%
41stGnome Sort47ms50ms233%
42ndCycle Sort50ms53ms145%
43rdSmooth Sort54ms51ms130%
44thCounting Sort246ms272ms85%
45thBitonic Sort Parallel255ms218ms474%
46thPigeonhole Sort2s 53ms1s 628ms236%
47thSleep Sort2s 102ms2s 102ms5%
48thStooge Sort10s 787ms11s 37ms71%
49thBead Sort2min 2s 370ms1min 59s 429ms66%

Array Size: 1000

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort, Replacement Selection Sort, Burst Sort, Bucket Sort, Flash Sort, Polyphase Merge Sort, Spreadsort, Intro Sort, Merge Insertion Sort, MSD Radix Sort, MSD Radix Sort In-Place, Tree Sort, Patience Sort, Quick Sort, Hyper Quick, Franceschini's Method, Radix Sort, Postman Sort, LSD Radix Sort, Comb Sort, Shell Sort, I Can't Believe It Can Sort, Tim Sort, Merge Sort, Heap Sort, Block Sort, Sample Sort, Merge Sort In-Placeless than a msless than a ms
29thStrand Sort6ms6ms193%
30thSorting Network10ms9ms520%
31stSpaghetti Sort11ms10ms427%
32ndLibrary Sort14ms13ms427%
33rdInsertion Sort28ms29ms159%
34thSelection Sort30ms31ms222%
35thTournament Sort38ms38ms59%
36thPancake Sort40ms42ms164%
37thExchange Sort42ms43ms167%
38thCocktail Sort53ms55ms95%
39thBubble Sort56ms57ms122%
40thOdd-Even Sort61ms63ms137%
41stGnome Sort77ms80ms105%
42ndCycle Sort84ms87ms96%
43rdSmooth Sort120ms118ms91%
44thBitonic Sort Parallel214ms199ms127%
45thCounting Sort231ms238ms96%
46thPigeonhole Sort1s 412ms1s 349ms87%
47thSleep Sort2s 163ms2s 162ms8%
48thStooge Sort10s 648ms10s 635ms12%
49thBead Sort2min 34s 661ms2min 26s 348ms64%

Array Size: 2500

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort, Replacement Selection Sort, Burst Sort, Bucket Sort, Flash Sort, Spreadsort, Polyphase Merge Sortless than a msless than a ms
8thIntro Sort, MSD Radix Sort, MSD Radix Sort In-Place, Merge Insertion Sort, Hyper Quick, Postman Sort, Tree Sort, LSD Radix Sort, Radix Sort, Quick Sort, Franceschini's Method, Patience Sort, Comb Sort, I Can't Believe It Can Sort, Tim Sort, Shell Sort, Merge Sort, Heap Sort3ms3ms
26thBlock Sort10ms8ms73%
27thSample Sort, Merge Sort In-Place13ms11ms
29thStrand Sort20ms20ms118%
30thSorting Network31ms29ms70%
31stSpaghetti Sort44ms42ms66%
32ndLibrary Sort63ms58ms224%
33rdInsertion Sort144ms142ms58%
34thSelection Sort146ms143ms64%
35thBitonic Sort Parallel184ms183ms40%
36thCounting Sort190ms188ms56%
37thTournament Sort192ms195ms56%
38thPancake Sort207ms206ms47%
39thExchange Sort221ms220ms41%
40thCocktail Sort276ms274ms45%
41stBubble Sort309ms306ms46%
42ndOdd-Even Sort316ms312ms90%
43rdGnome Sort398ms395ms44%
44thCycle Sort451ms451ms36%
45thSmooth Sort844ms842ms19%
46thPigeonhole Sort1s 314ms1s 317ms58%
47thSleep Sort2s 459ms2s 451ms14%
48thStooge Sort3min 53s 890ms3min 47s 923ms33%
49thBead Sort6min 36s 894ms6min 0s 978ms92%

Note: The following algorithm were removed for this array size due to performance issues: Bead Sort (at size 2500)

Array Size: 5000

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort, Replacement Selection Sort2ms2ms
3rdBurst Sort, Bucket Sort, Flash Sort, Spreadsort4ms4ms
7thPolyphase Merge Sort7ms6ms311%
8thTree Sort8ms8ms84%
9thMSD Radix Sort, Intro Sort, MSD Radix Sort In-Place, Tim Sort10ms9ms
13thPostman Sort, LSD Radix Sort, Merge Insertion Sort, Radix Sort, Hyper Quick12ms12ms
18thQuick Sort, Franceschini's Method13ms13ms
20thI Can't Believe It Can Sort, Merge Sort, Comb Sort, Shell Sort16ms16ms
24thPatience Sort19ms19ms80%
25thHeap Sort21ms21ms73%
26thBlock Sort45ms44ms93%
27thSample Sort51ms51ms59%
28thStrand Sort55ms54ms73%
29thMerge Sort In-Place60ms61ms50%
30thSorting Network103ms104ms32%
31stSpaghetti Sort258ms258ms45%
32ndCounting Sort287ms286ms32%
33rdLibrary Sort373ms342ms219%
34thBitonic Sort Parallel577ms571ms97%
35thTournament Sort712ms710ms33%
36thSelection Sort823ms823ms16%
37thInsertion Sort841ms839ms22%
38thExchange Sort1s 202ms1s 201ms14%
39thPancake Sort1s 228ms1s 228ms13%
40thCocktail Sort1s 630ms1s 627ms17%
41stBubble Sort1s 849ms1s 846ms14%
42ndOdd-Even Sort1s 880ms1s 881ms31%
43rdGnome Sort2s 351ms2s 332ms37%
44thCycle Sort2s 588ms2s 584ms18%
45thPigeonhole Sort2s 745ms2s 724ms62%
46thSleep Sort3s 420ms3s 430ms19%
47thSmooth Sort5s 928ms5s 926ms9%
48thStooge Sort21min 12s 585ms15min 37s 135ms1914%

Note: The following algorithm were removed for this array size due to performance issues: Stooge Sort (at size 5000)

Array Size: 7500

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort, Replacement Selection Sort2ms2ms
3rdBurst Sort, Bucket Sort, Flash Sort, Spreadsort4ms4ms
7thPolyphase Merge Sort7ms6ms154%
8thMSD Radix Sort, MSD Radix Sort In-Place, Intro Sort, Postman Sort, LSD Radix Sort, Radix Sort, Merge Insertion Sort, Tree Sort, Hyper Quick, Quick Sort10ms9ms
18thTim Sort, Franceschini's Method17ms16ms
20thI Can't Believe It Can Sort, Merge Sort19ms18ms
22ndComb Sort, Shell Sort21ms20ms
24thHeap Sort, Patience Sort24ms23ms
26thBlock Sort56ms55ms66%
27thSample Sort68ms66ms64%
28thSorting Network81ms80ms64%
29thMerge Sort In-Place88ms86ms65%
30thStrand Sort105ms103ms69%
31stCounting Sort217ms214ms54%
32ndBitonic Sort Parallel298ms295ms49%
33rdSpaghetti Sort439ms438ms43%
34thLibrary Sort622ms567ms217%
35thSelection Sort1s 423ms1s 422ms25%
36thInsertion Sort1s 434ms1s 426ms32%
37thPigeonhole Sort1s 455ms1s 443ms43%
38thTournament Sort1s 599ms1s 596ms25%
39thPancake Sort2s 141ms2s 136ms36%
40thExchange Sort2s 144ms2s 144ms20%
41stCocktail Sort2s 721ms2s 716ms27%
42ndOdd-Even Sort3s 160ms3s 118ms162%
43rdBubble Sort3s 169ms3s 129ms30%
44thGnome Sort3s 907ms3s 894ms35%
45thSleep Sort4s 162ms4s 140ms10%
46thCycle Sort4s 447ms4s 441ms20%
47thSmooth Sort16s 867ms16s 864ms8%

Array Size: 10,000

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort, Replacement Selection Sort3ms3ms
3rdBurst Sort, Bucket Sort, Flash Sort6ms5ms
6thSpreadsort8ms8ms118%
7thPolyphase Merge Sort10ms9ms87%
8thMSD Radix Sort14ms13ms84%
9thMSD Radix Sort In-Place, Intro Sort, Postman Sort, Radix Sort, LSD Radix Sort15ms14ms
14thMerge Insertion Sort, Hyper Quick, Quick Sort19ms19ms
17thTree Sort22ms22ms130%
18thFranceschini's Method23ms23ms72%
19thI Can't Believe It Can Sort, Tim Sort, Merge Sort26ms25ms
22ndComb Sort30ms29ms101%
23rdShell Sort32ms31ms73%
24thHeap Sort34ms33ms63%
25thPatience Sort37ms36ms103%
26thBlock Sort82ms81ms68%
27thSample Sort104ms103ms61%
28thMerge Sort In-Place149ms147ms65%
29thSorting Network, Strand Sort195ms192ms
31stCounting Sort217ms215ms49%
32ndBitonic Sort Parallel385ms383ms59%
33rdSpaghetti Sort900ms884ms35%
34thLibrary Sort1s 107ms1s 19ms229%
35thPigeonhole Sort1s 453ms1s 442ms54%
36thInsertion Sort2s 557ms2s 557ms18%
37thSelection Sort2s 575ms2s 571ms32%
38thTournament Sort3s 384ms3s 371ms32%
39thExchange Sort3s 868ms3s 868ms20%
40thPancake Sort3s 915ms3s 905ms31%
41stCocktail Sort4s 927ms4s 903ms21%
42ndSleep Sort5s 9ms4s 997ms9%
43rdBubble Sort5s 627ms5s 600ms42%
44thOdd-Even Sort5s 695ms5s 667ms42%
45thGnome Sort7s 43ms7s 1ms38%
46thCycle Sort8s 48ms8s 45ms14%
47thSmooth Sort39s 849ms39s 990ms18%

Array Size: 25,000

RankAlgorithm(s)Average TimeMedian TimeVariance (%)
1stCubesort8ms8ms74%
2ndReplacement Selection Sort10ms9ms60%
3rdBurst Sort15ms14ms142%
4thFlash Sort, Bucket Sort18ms18ms
6thSpreadsort, Polyphase Merge Sort26ms25ms
8thMSD Radix Sort35ms35ms68%
9thMSD Radix Sort In-Place39ms38ms69%
10thPostman Sort, Intro Sort, Radix Sort42ms41ms
13thLSD Radix Sort44ms43ms69%
14thMerge Insertion Sort51ms49ms63%
15thQuick Sort55ms54ms59%
16thHyper Quick62ms63ms69%
17thMerge Sort, Franceschini's Method69ms68ms
19thTree Sort72ms70ms116%
20thI Can't Believe It Can Sort76ms75ms72%
21stComb Sort88ms87ms92%
22ndTim Sort94ms92ms86%
23rdShell Sort97ms96ms57%
24thHeap Sort109ms109ms59%
25thPatience Sort133ms131ms67%
26thCounting Sort226ms226ms40%
27thSample Sort383ms381ms37%
28thBlock Sort393ms387ms43%
29thSorting Network541ms544ms42%
30thBitonic Sort Parallel693ms683ms64%
31stMerge Sort In-Place856ms853ms30%
32ndStrand Sort967ms961ms32%
33rdPigeonhole Sort1s 420ms1s 408ms53%
34thLibrary Sort6s 529ms5s 902ms245%
35thSpaghetti Sort6s 887ms6s 908ms15%
36thSleep Sort10s 381ms10s 368ms8%
37thSelection Sort16s 134ms16s 36ms19%
38thInsertion Sort17s 151ms16s 519ms79%
39thTournament Sort24s 380ms24s 402ms17%
40thPancake Sort25s 884ms25s 857ms14%
41stExchange Sort26s 849ms26s 757ms36%
42ndOdd-Even Sort36s 46ms35s 947ms25%
43rdCocktail Sort37s 161ms34s 327ms89%
44thBubble Sort40s 294ms40s 1ms27%
45thGnome Sort49s 198ms49s 74ms21%
46thCycle Sort57s 750ms57s 620ms33%
47thSmooth Sort9min 16s 324ms9min 3s 240ms41%

Note: The following algorithm were removed for this array size due to performance issues: Smooth Sort (at size 25,000)

About

My overengineered sorting algorithm test

Resources

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages