Re: Sorted Hash



Salvador Fandino <sfandino@xxxxxxxxx> wrote in news:fiorj9$gto$1
@hefestos.uned.es:

palexvs@xxxxxxxxx wrote:
I filled hash and then printed it (sorted by key):
my %hs = (
key10 => 5,
key5 => b,
aey9 => 7,
)
foreach my $k (sort keys %hs) { print "$k $hs{$k}\n"; }

key - string ([0-9A-F]{72}), 50K records.
How do it more effective?


yu can use the radix sort implementation available from
Sort::Key::Radix
that is usually faster for this kind of data that the merge sort used
internally by perl:

Does sorting speed matter when most of the time is spent printing?

Sinan


--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>

.