in reply to Looking for ways to speed up the parsing of a file...
One thing that jumps out at me skimming your code is this pattern:
if ($_ =~ /^\s+total wire length\:\s+\d.*\d\s*/) { ($NetLength) = $_ =~ /^\s+total wire length\:\s+(\ +d.*\d)\s*/;
There's no need to use two regexes here, and also no need to be explicit about $_ (it's the default match target). You can just do:
if (/^\s+total wire length\:\s+(\d.*\d)\s*/) { $NetLength = $1;
That should shave off a bit of time.
Another possibility to consider that profiling won't immediately suggest is parallellization. Do you have multiple CPUs or multiple machines at your disposal? If so, divide the file into pieces and hand them off to multiple processes to work on simulataneously.
-sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looking for ways to speed up the parsing of a file...
by pc88mxer (Vicar) on May 17, 2008 at 19:26 UTC |