in reply to Re: modification of the script to consume less memory with higher speed
in thread modification of the script to consume less memory with higher speed

For this particular use case, I saw lesser memory consumption using the following for output. Your mileage may vary. This is without sorting.

my $tot; foreach my $key1 ( keys %seen ) { if ( @{ $seen{$key1} } >= $file_count ) { $tot = 0; for my $val ( @{ $seen{$key1} } ) { # $tot += ( split /:/, $val )[0]; $tot += $val; # Perl ignores the string after number } print join "\t", @{ $seen{$key1} }; print "\tcount:". $tot."\n\n"; } }

Regards.

  • Comment on Re^2: modification of the script to consume less memory with higher speed
  • Download Code