Comb Sort versus Quick Sort
#4
Hi bplus,
here comes a showdown (based on your code):

You can see that sometimes using SHELL with superfast sorter (both in EXE/ELF) is way to go EVEN when the data is passed via a file?!

Sometimes, sorting strings is an extra burden since they can come from a file, we need to load and parse them before sorting, in my tweak to your code, you can see three more approaches:

Code: (Select All)
'Benchmark (sorting 3,000,000 strings, up to 62 chars) on Windows 10 and i5-7200U 3.1GHz Max Turbo:
' Quicksort recursive:               8.16s
' Quicksort iterative:               7.54s
' Quicksort 'Magnetica':             4.22s
' Quicksort multithreaded Magnetica: 1.82s


Attached Files Image(s)
   

.7z   QB64_qsort.7z (Size: 1,014.74 KB / Downloads: 48)
"He learns not to learn and reverts to what the masses pass by."
Reply


Messages In This Thread
Comb Sort versus Quick Sort - by bplus - 05-30-2023, 07:06 PM
RE: Comb Sort versus Quick Sort - by Dimster - 05-31-2023, 02:00 PM
RE: Comb Sort versus Quick Sort - by bplus - 05-31-2023, 02:39 PM
RE: Comb Sort versus Quick Sort - by Sanmayce - 07-11-2023, 04:34 PM
RE: Comb Sort versus Quick Sort - by bplus - 07-12-2023, 12:27 AM
RE: Comb Sort versus Quick Sort - by Sanmayce - 07-12-2023, 02:28 PM
RE: Comb Sort versus Quick Sort - by bplus - 07-12-2023, 02:58 PM
RE: Comb Sort versus Quick Sort - by Sanmayce - 07-13-2023, 07:28 PM
RE: Comb Sort versus Quick Sort - by Sanmayce - 07-13-2023, 07:31 PM
RE: Comb Sort versus Quick Sort - by bplus - 07-13-2023, 09:17 PM
RE: Comb Sort versus Quick Sort - by SMcNeill - 07-13-2023, 10:00 PM
RE: Comb Sort versus Quick Sort - by Sanmayce - 07-14-2023, 01:21 PM
RE: Comb Sort versus Quick Sort - by SMcNeill - 07-14-2023, 02:10 PM
RE: Comb Sort versus Quick Sort - by bplus - 07-14-2023, 01:35 PM



Users browsing this thread: 1 Guest(s)