in reply to Re: Sorting by Array values, obtaining indices
in thread Sorting by Array values, obtaining indices
Do you?
use strict; use Devel::Size qw(total_size); my %hash = ( 0 => 3, 1 => 7, 2 => 5, 3 => 0, 4 => 2, ); my @vals = qw(3 7 5 0 2); print 'T1: ', total_size(\%hash),"\n"; print 'T2: ', total_size(\@vals),"\n";
30% less space for the array, same access speed. There need to be as many of these data structures in memory as possible. qed
Bye
PetaMem All Perl: MT, NLP, NLU
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sorting by Array values, obtaining indices
by waswas-fng (Curate) on Jun 27, 2005 at 17:08 UTC | |
|
Re^3: Sorting by Array values, obtaining indices
by Limbic~Region (Chancellor) on Jun 27, 2005 at 16:44 UTC |