I've done research on sorting in the past, working with 100,000 to
1,000,000 element lists.
Allen: LOCATE's are faster, but only when you're dealing with less than
100 elements. Because LOCATE's must start at the beginning of a string
and traverse the entire length, they get slower and slower. Bubble
sorts are also useless when dealing with a large number of elements.
Jeff: Yes, a C program is the fastest (at least it was at my last job
where we used GCI to integrate it with the universe shell.)
As for writing out ids to work files just to sort them, it adds
unnecessary overhead to the whole process.
I wish universe had an intrinsic sort() function. Since they don't I
wrote my own and posted it on PickWiki. You could also use the
QuickSort sample posted in this thread. Once you standardize on a
particular sorting program, you'll be amazed at the number of times it
comes in handy.
http://www.pickwiki.com/cgi-bin/wiki.pl?Sorting
http://www.pickwiki.com/cgi-bin/wiki.pl?ShellSort
http://www.pickwiki.com/cgi-bin/wiki.pl?QuickSort
Another handy function is to be able to flip fields to values and vice
versa. See http://www.pickwiki.com/cgi-bin/wiki.pl?Row2Col and again
it's optimized for a large number of elements.
rex
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/