[04 Dec 2008] Sort and locale
Posted: Sat Jun 13, 2020 5:32 pm
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 04 Dec 2008 00:54:21 +0100
Hello Andreas!
The story started when I wanted to play an animation while sorting a large text table.
I made a quicksort function and the result shocked me.
The same table which takes 4913 ms to sort by the Sort() function takes ~0 ms (zero) by the quicksort algorithm.
I know that optimization is behind functionality, but what could cause such a huge difference?
The problem is with all of the sort methods that I cannot sort accented characters correctly. It would be great to have a function that use locale.library/StrnCmp (on the Amiga, and whatever function on other systems) then I could use it in my quicksort function.
The second problem is that I couldn't figured out how can I pass a table to a function. I'd like to make a p_qsort(table,first,last) function to be useable generally. Currently I had to hardwire the table name in the function.
And one last question: Should I reserve from the Christmas money for a soon to be released new Hollywood upgrade?
Hello Andreas!
The story started when I wanted to play an animation while sorting a large text table.
I made a quicksort function and the result shocked me.
The same table which takes 4913 ms to sort by the Sort() function takes ~0 ms (zero) by the quicksort algorithm.
I know that optimization is behind functionality, but what could cause such a huge difference?
The problem is with all of the sort methods that I cannot sort accented characters correctly. It would be great to have a function that use locale.library/StrnCmp (on the Amiga, and whatever function on other systems) then I could use it in my quicksort function.
The second problem is that I couldn't figured out how can I pass a table to a function. I'd like to make a p_qsort(table,first,last) function to be useable generally. Currently I had to hardwire the table name in the function.
And one last question: Should I reserve from the Christmas money for a soon to be released new Hollywood upgrade?