in reply to Faster push and shift
If reading the file WITHOUT doing significant processing takes already 10 minutes, this must be a tremendously huge file, and maybe you should think your algorithm all over. However, from your code it is not clear what you are wanting to do. You are populating @a and @b, but never use them anywhere.
There is one more thing which puzzles me: Usually, input/output time dominates processing time, unless you do a lot of processing for your input records. You keep your arrays small (@a and @b never grow larger than 6 elements), so the operation on the arrays doesn't impact the run-time significantly. The regexp also is simple enough that I don't think that the processing time of this regexp could be 15 times the reading-time of a record. I would conclude, that the processing time is not lost by your coding, but to be sure, you could insert timer calls in your loop.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Faster push and shift
by BrowserUk (Patriarch) on Feb 16, 2012 at 12:07 UTC | |
by rovf (Priest) on Feb 16, 2012 at 12:29 UTC | |
by locked_user sundialsvc4 (Abbot) on Feb 16, 2012 at 13:53 UTC |