in reply to Optimization of DB_File sorting and processing code
You need to separate out the time it's taking to open the file and do file I/O from the time it's taking to interate over the keys and build the matrix.
Do this: Comment out everything between the tie and the untie (missing, but worth adding for general cleanliness). If this doesn't have a significant impact on runtime, then your answer is "buy a faster disk" (or defrag the one you've got).
Next step is to comment out the code that's building the matrix (after doing each %hash). This retains the disk IO for reading keys, while separating out the overhead for your data structures. If this doesn't have a significant effect of overall runtime, answers range from "buy a faster disk" to "precache the keys in the db".
I really doubt this is due to your matrix building code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: optimize this code?
by Evanovich (Scribe) on Feb 09, 2002 at 07:18 UTC | |
by dws (Chancellor) on Feb 09, 2002 at 08:41 UTC | |
by Evanovich (Scribe) on Feb 09, 2002 at 14:34 UTC | |
by dws (Chancellor) on Feb 09, 2002 at 19:43 UTC | |
by Evanovich (Scribe) on Feb 11, 2002 at 17:40 UTC |