in reply to Looking for ways to speed up the parsing of a file...
That said, here are some small improvements to your code that could result in better performance:
1) Use elsif where possible, i.e.:
From your example file, it doesn't seem like you'll see both wire capacitance and wire resistance on the same line. Also, consider using elsif in the other chain of if statements if only one condition can be true at a time.if (/wire capacitance/) { ... } elsif (/wire resistance/) { ...
2) Use: if ($TotalNets % 50_000 == 0 && $TotalNets > 0) ... to test if you want to print out the trace message. It's simpler, cleaner and faster.
|
|---|