At present, we have sorts tested for two kinds of Date, Integer, Long, Double, BigInteger, and BigDecimal. The first four of these are "perfect" encodings and not very interesting (although still a lot faster than sorting them by system sort). The third thru fifth are rather unimportant because if we had a lot of such values to sort, we would convert them into an array of primitives first and use quicksort.
I'd like to see a sort on some other kind of object which does not have perfect encoding. I haven't been able to think of a good example. But one possibility would be, say, where we want to sort a tuple for a database where the tuple includes things like name, social security number, address (including zip code). That would be a good demonstration of the idea, I think, because the normal strategy is to sort (for indexing purposes) only on the primary key (e.g. SSN). A second sort on one of the other columns would, of course, be expensive. Instead, we could define an encoding which, for example, sorted on name first, then on zip code, etc. We would have everything in our ideal order all in one shot!
At present, we have sorts tested for two kinds of Date, Integer, Long, Double, BigInteger, and BigDecimal. The first four of these are "perfect" encodings and not very interesting (although still a lot faster than sorting them by system sort). The third thru fifth are rather unimportant because if we had a lot of such values to sort, we would convert them into an array of primitives first and use quicksort.
I'd like to see a sort on some other kind of object which does not have perfect encoding. I haven't been able to think of a good example. But one possibility would be, say, where we want to sort a tuple for a database where the tuple includes things like name, social security number, address (including zip code). That would be a good demonstration of the idea, I think, because the normal strategy is to sort (for indexing purposes) only on the primary key (e.g. SSN). A second sort on one of the other columns would, of course, be expensive. Instead, we could define an encoding which, for example, sorted on name first, then on zip code, etc. We would have everything in our ideal order all in one shot!