04-05-2005, 04:02 AM
Naah, IIRC the DQB array sorting routine used bubble sort, which is much slower than quick sort.
Better to recode a quick sort routine from scratch using the inline asm FB provides, if the array sorting is the real bottleneck of your app.
A hint to speed things up: don't sort the strings. Sort pointers to the string. I mean, have a complementary array of pointers to each string of your original array, then do the sort on this. This way when two elements are to be swapped, you just swap 4 bytes with a single MOV, instead of copying the whole string.
Better to recode a quick sort routine from scratch using the inline asm FB provides, if the array sorting is the real bottleneck of your app.
A hint to speed things up: don't sort the strings. Sort pointers to the string. I mean, have a complementary array of pointers to each string of your original array, then do the sort on this. This way when two elements are to be swapped, you just swap 4 bytes with a single MOV, instead of copying the whole string.
ngelo Mottola - EC++