in reply to Perl Optimization
Using a single precompiled regex may help:
my $matchStr = join '|', map {$hash{$_}[0]} keys %hash; my $match = qr/($matchStr)/i; while (my $cur_line = <fh_log>) { #If this query contains reference to this table next if $cur_line !~ $match; #count up how many times this table is referenced. $table_stats{$1}++; $table_refs++; #total table references (for % calc) }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Optimization
by ikegami (Patriarch) on Aug 09, 2008 at 00:29 UTC |