Re: map/array performance

2005-10-24 Thread Frank Bax
At 10:07 PM 10/23/05, Jeff 'japhy' Pinyan wrote: On Oct 23, Frank Bax said: my $aval=''; map { $aval=$aval.sprintf("%4d",$aSuit{$a}{$_}); } @f_seq; my $aval=''; foreach $f (@f_seq) { $aval=$aval.sprintf("%4d",$aSuit{$a}{$f}); } You should be using $aval .= here, instead of $

Re: map/array performance

2005-10-23 Thread Jeff 'japhy' Pinyan
On Oct 23, Frank Bax said: my $aval=''; map { $aval=$aval.sprintf("%4d",$aSuit{$a}{$_}); } @f_seq; my $aval=''; foreach $f (@f_seq) { $aval=$aval.sprintf("%4d",$aSuit{$a}{$f}); } You should be using $aval .= here, instead of $aval = $aval . And as John has shown, join()

Re: map/array performance

2005-10-23 Thread John W. Krahn
Frank Bax wrote: > At 02:11 PM 10/23/05, John W. Krahn wrote: > >> Frank Bax wrote: >> > my $snew = >> > sprintf("%4d%4d",$aSuit{$new}{'rescap'},$aSuit{$new}{'resval'}); >> > my $slow = >> > sprintf("%4d%4d",$aSuit{$low}{'rescap'},$aSuit{$low}{'resval'}); >> >> Using sprintf() to c

Re: map/array performance

2005-10-23 Thread Frank Bax
At 04:35 PM 10/23/05, Frank Bax wrote: At 02:11 PM 10/23/05, John W. Krahn wrote: Frank Bax wrote: > my $snew = > sprintf("%4d%4d",$aSuit{$new}{'rescap'},$aSuit{$new}{'resval'}); > my $slow = > sprintf("%4d%4d",$aSuit{$low}{'rescap'},$aSuit{$low}{'resval'}); Using sprintf() to

Re: map/array performance

2005-10-23 Thread Jeff 'japhy' Pinyan
On Oct 23, Frank Bax said: At 02:11 PM 10/23/05, John W. Krahn wrote: Frank Bax wrote: > my $aval=''; map { $aval=$aval.sprintf("%4d",$aSuit{$a}{$_}); } @f_seq; > my $bval=''; map { $bval=$bval.sprintf("%4d",$aSuit{$b}{$_}); } @f_seq; You shouldn't use map in void context, you sho

Re: map/array performance

2005-10-23 Thread Frank Bax
At 02:11 PM 10/23/05, John W. Krahn wrote: Frank Bax wrote: > my $snew = > sprintf("%4d%4d",$aSuit{$new}{'rescap'},$aSuit{$new}{'resval'}); > my $slow = > sprintf("%4d%4d",$aSuit{$low}{'rescap'},$aSuit{$low}{'resval'}); Using sprintf() to concatenate numbers is (AFAIK) going to

Re: map/array performance

2005-10-23 Thread John W. Krahn
John W. Krahn wrote: > Frank Bax wrote: >>Rather than create/store/sort many billion entities, my script creates >>these entities dynamically and maintains a hash of the "top 100". As >>each entity is created, I search my hash for the entity with "lowest" >>value, based on a number of elements in

Re: map/array performance

2005-10-23 Thread John W. Krahn
Frank Bax wrote: > Rather than create/store/sort many billion entities, my script creates > these entities dynamically and maintains a hash of the "top 100". As > each entity is created, I search my hash for the entity with "lowest" > value, based on a number of elements in the hash; then "low" el

map/array performance

2005-10-23 Thread Frank Bax
Rather than create/store/sort many billion entities, my script creates these entities dynamically and maintains a hash of the "top 100". As each entity is created, I search my hash for the entity with "lowest" value, based on a number of elements in the hash; then "low" element gets replaced w