in reply to Re: Sorting a (very) large file
in thread Sorting a (very) large file
Or you could try something twice as fast that uses much less memory. In this case I'd likely sort parallel arrays (though it isn't too complicated to do something even faster that uses even less memory, such as fast, flexible, stable sort).
my @size= map { ( split /\t/, $_ )[2] } @in; my @idx= sort { $size[$a] <=> $size[$b] }, 0..$#in; @in= @in[@idx];
And I'd check how much paging space is configured. It sounds like that could be increased.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sorting a (very) large file (better*2)
by samtregar (Abbot) on Nov 30, 2007 at 20:13 UTC | |
by tye (Sage) on Nov 30, 2007 at 20:15 UTC | |
by samtregar (Abbot) on Nov 30, 2007 at 20:19 UTC | |
by samtregar (Abbot) on Nov 30, 2007 at 20:32 UTC | |
by salva (Canon) on Dec 01, 2007 at 16:43 UTC | |
| |
by tye (Sage) on Nov 30, 2007 at 20:37 UTC | |
by samtregar (Abbot) on Nov 30, 2007 at 20:41 UTC | |
|