HPCsharp
HPCsharp copied to clipboard
Fast String sorting
I am trying to find the fastest way to sort strings (actually an array of ascii byte*), and have came across https://www.codeproject.com/articles/146086/fast-string-sort-in-c-and-f. It works very well for me. However, it only utilizes a single thread (it uses multikey-quicksort). I tried to use HPCsharps parallel merge sort with the same data, however, on a 24-thread system, it was only slightly faster than the codeproject article mentioned. I was wondering if there was an even faster way to sort an array of byte* pointing to ASCII text, preferably parallel.
Sorry if this is a bad place to put it. Thanks
Would you mind posting your benchmark? There are a couple of thresholds that have been optimized for sorting arrays of integers, which most likely need changed for sorting an array of strings (array of ascii byte pointers). Another idea is to place all string (byte*'s) in an array and hand these to a sorting algorithm. This reduces random memory accesses, due to strings being scattered randomly in system memory, which slows performance down significantly. You could then provide an array of strings to the sort algorithm, and an array of starting addresses and lengths. Let me know if you can sponsor this further work.