Sorry, that’s incorrect.
The point of the GRT is to call upon sort without a callback attached. (This is done by packing all the sortkeys and the actual data into a single datum in such a way that a simple $a cmp $b, which is the default sort behaviour, will result in the desired order (hence its alternative name “packed-default sort”).)
The GRT (and the ST alike) directly sorts the elements themselves, with an extra step to extract the payload from each element afterwards.
The approach I’m using here differs on both counts. It uses a sort callback, unlike the GRT, and sorts indices, unlike both the ST and the GRT.
Its similarity is in having an extra step before sorting and another after, where the before-sorting step has the same purpose in all cases, i.e. computing the sort key for each element only once. The storage used for the computed keys differs greatly for each approach though, and therefore so do their after-sorting steps.
Makeshifts last the longest.
| [reply] [d/l] |