stan131 has asked for the wisdom of the Perl Monks concerning the following question:
%hash1 = {1=>{air->'5',water->'6'}, 2=>{orange->'2',air->'4',soup->'10'} }; %hash2 = {$filename} = \%hash1;
This piece of code is taking about 40 minutes to run. How can I improve on this.for $a (sort keys %mstrToken) { $df = 1; foreach $doc (@docNames) { %tempHash = %{$hash2 {$doc}}; if(exists $tempHash{$a}) { $tkfreq = $tempHash{$a}; $mh{$a}->{'docf'}=$df++; $mh{$a}->{$doc} =$tkfreq; } } #end of file processing for loop }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hashes performance issue
by BrowserUk (Patriarch) on Mar 29, 2009 at 01:42 UTC | |
by stan131 (Acolyte) on Mar 29, 2009 at 04:50 UTC | |
|
Re: hashes performance issue
by Your Mother (Archbishop) on Mar 29, 2009 at 00:57 UTC | |
|
Re: hashes performance issue
by Bloodnok (Vicar) on Mar 29, 2009 at 00:36 UTC | |
by stan131 (Acolyte) on Mar 29, 2009 at 00:56 UTC |