If you need 1.4GB to sort 400MB that means that you are probably converting numbers to strings inside the sort.
Yep! That's the problem.
{ ($c, $d) = ($a,$b); $c cmp $d
I wonder if that optimisation could be worked into the internal sort?
I started to suggest that if both had the (same) IOK or NOK flags set, then use a numeric comparison, but I guess it would only take one string embeded at the wrong place for the entire sort to have to be done over.
In reply to Re^6: Howto Avoid Memory Problem in List::MoreUtils
by BrowserUk
in thread Howto Avoid Memory Problem in List::MoreUtils
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |