greatchap
May 25th, 2010, 09:37 AM
Hi Guys,
I have developed a vb.net dll (.net 3.5) which does the following :
- I have data of several stock market companies.
- They are stored in several folders under a main folder.
- These files are random access files.
- There can be around 4000 files in total for example.
I wrote a program which reads a current csv file and stores contents in array. Then I store name and path of companies in folders (which I was talking about). Then I match one company from csv (stored in array) to companies in user's folder (again reading from array). If found I insert data in the file (random access file).
This whole process takes for eg. 2 min my system. A similar program was written years ago by someone in powerbasic which takes slight less time if run one but if run for multiple csv files it takes only a few seconds doing the same thing for other files.
When I do the same thing (by writing code to .net dll) and making a dummy app to run it, no matter how many times I run it takes same time. And is way slower than the earlier one (PB) one I was talking about. But if I paste the same code in my win (.net) app and not use .net dll then it runs a bit faster.
Why??
I know all this may sound a little unfocussed or ambigious. But I have been in a fix for few days. I am trying to improve the performance of this applicaiton which I made. What important things should I keep in mind?
I need to show status so if I pass my form's label reference to .net dll and it updates it does that slow down process a lot. As I mentioned I am trying to process the files and it takes longer in .net. What should I do to get best performance?
Unfortunately due to unexplainable reasons I cannot change the format or use a db. The files which I am reading/writing (random access files) are use by other products so I have to stick to that format.
What I am doing is storing the location of those files in array so that I dont have to search folder again. that is not taking time. But opening reading and writing files is time consuming if i am doing it for few thousand of them. A similar program in powerbasic (developed years ago) runs fast.
Running code thru .net dll is slower than running it thru program. Why?
[Image attached (see attachment) which explains a bit]
Any commens will be welcome.
Thanks a lot,
Cheers,
GR
I have developed a vb.net dll (.net 3.5) which does the following :
- I have data of several stock market companies.
- They are stored in several folders under a main folder.
- These files are random access files.
- There can be around 4000 files in total for example.
I wrote a program which reads a current csv file and stores contents in array. Then I store name and path of companies in folders (which I was talking about). Then I match one company from csv (stored in array) to companies in user's folder (again reading from array). If found I insert data in the file (random access file).
This whole process takes for eg. 2 min my system. A similar program was written years ago by someone in powerbasic which takes slight less time if run one but if run for multiple csv files it takes only a few seconds doing the same thing for other files.
When I do the same thing (by writing code to .net dll) and making a dummy app to run it, no matter how many times I run it takes same time. And is way slower than the earlier one (PB) one I was talking about. But if I paste the same code in my win (.net) app and not use .net dll then it runs a bit faster.
Why??
I know all this may sound a little unfocussed or ambigious. But I have been in a fix for few days. I am trying to improve the performance of this applicaiton which I made. What important things should I keep in mind?
I need to show status so if I pass my form's label reference to .net dll and it updates it does that slow down process a lot. As I mentioned I am trying to process the files and it takes longer in .net. What should I do to get best performance?
Unfortunately due to unexplainable reasons I cannot change the format or use a db. The files which I am reading/writing (random access files) are use by other products so I have to stick to that format.
What I am doing is storing the location of those files in array so that I dont have to search folder again. that is not taking time. But opening reading and writing files is time consuming if i am doing it for few thousand of them. A similar program in powerbasic (developed years ago) runs fast.
Running code thru .net dll is slower than running it thru program. Why?
[Image attached (see attachment) which explains a bit]
Any commens will be welcome.
Thanks a lot,
Cheers,
GR