in reply to Size of the Array
On a Windows XP PC with 1 gigabyte of main memory and a Pentium IV, I can sort two million 24-bytes strings in just over half a minute, but trying to sort four million caused major thrashing (the whole machine slows to a crawl) followed by Perl dying with "out of memory."
Fifty thousand filenames shouldn't be a problem on reasonably recent machines.
perl -wle '@a=(1..2_000_000); @b=sort map {scalar gmtime $_} @a; print + "@b[0,1,2,1_999_997,1_999_998,1_999_999]"'
Fri Jan 2 00:00:00 1970 Fri Jan 2 00:00:01 1970 Fri Jan 2 00:00:02 +1970 Wed Jan 21 23:59:57 1970 Wed Jan 21 23:59:58 1970 Wed Jan 21 23: +59:59 1970 34.42user 0.32system 0:35.76elapsed 97%CPU (0avgtext+0avgdata 29949952 +maxresident)k 0inputs+0outputs (122789major+0minor)pagefaults 0swaps
|
|---|