BTW: If I ever manage to get the keys out of the hash and into an array without blowing memory, then I intend to use your Sort::Key to sort them in-place. But, there doesn't seem to be a an in-place version of keysort that doesn't take a callback?
It seems the interface is not very consistent... actually, the function exists, it is Sort::Key::_sort_inplace.
In any case, perl builtin sort will perform equally faster as @k = sort @k gets optimized by the interpreter into an inplace operation.
BTW, using the quicksort algorithm instead of the default merge sort will also help to reduce memory usage.
In reply to Re^3: In-place sort with order assignment
by salva
in thread In-place sort with order assignment
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |