I have a program I have written for my son that works as expected. At a high level, the program works as follows, there is a Cost file for company products and a file that lists products a given customer buys. Using the test files I was given to work with, the Cost file contains nearly 1,100 records and the customer file contains 280. My current process steps through the records in the Customer file, obtains Product Name, Measure and Container Type. I then filter the Cost file on those 3 fields and make a decision of which record to use to write data over to the Customer file.
As it stands right now, the program takes about 8 minutes to complete and I know the primary reason is the fact that I am applying multiple filters, removing the filter and reapplying over and over again.
I am considering writing the cost file to an Array in an effort to speed up the program. I've used Arrays in the past but have to admit I'm very much a novice when it comes to using and manipulating data in an Array. So I have a few questions:
1. I assume if I use an Array it would significantly speed up the overall process. In general, given the size of the Cost file, would writing it to an Array cut processing time in half? More?
2. Should I continue with the concept of Filtering the Array or is that even necessary? Would the program still run significantly faster if I just step through the 1,100 records rather than apply a Filter?
So any help is much appreciated.
Frank
As it stands right now, the program takes about 8 minutes to complete and I know the primary reason is the fact that I am applying multiple filters, removing the filter and reapplying over and over again.
I am considering writing the cost file to an Array in an effort to speed up the program. I've used Arrays in the past but have to admit I'm very much a novice when it comes to using and manipulating data in an Array. So I have a few questions:
1. I assume if I use an Array it would significantly speed up the overall process. In general, given the size of the Cost file, would writing it to an Array cut processing time in half? More?
2. Should I continue with the concept of Filtering the Array or is that even necessary? Would the program still run significantly faster if I just step through the 1,100 records rather than apply a Filter?
So any help is much appreciated.
Frank