in reply to Re: Sorting a hash of arrays based on a particular array element.
in thread Sorting a hash of arrays based on a particular array element.
BTW, in my computer the difference between packed and BrowserUK method is not so big as on your test.... use Sort::Key qw(ikeysort); sub SortKey { my @sorted_keys = ikeysort { $hash{$_}[0] } keys %hash; } cmpthese(10, { BrowserUK => \&BrowserUK, packed_default => \&packed_default, SortKey => \&SortKey }); __end__ Rate BrowserUK packed_default SortKey BrowserUK 50.0/s -- -30% -45% packed_default 71.4/s 43% -- -21% SortKey 90.9/s 82% 27% --
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sorting a hash of arrays based on a particular array element.
by Random_Walk (Prior) on Jul 28, 2005 at 08:39 UTC | |
by salva (Canon) on Jul 28, 2005 at 10:10 UTC | |
|
Re^3: Sorting a hash of arrays based on a particular array element.
by Random_Walk (Prior) on Jul 28, 2005 at 12:28 UTC | |
by salva (Canon) on Jul 28, 2005 at 13:57 UTC |