I have a large program which does a lot of counting and calculation behind the scenes. When it enters this calculation stage, the windows form only has this to do, but I've set it as a background task "background worker" functions etc.
The calculating takes a large amount of time and I've done reading about how to minimise this. Possible (and followed through tips) were:
- decreasing module sizes
- passing data by reference/pointers
- not using gradient colors
- rendering allocated memory space free after use
- not using fancy graphics
Now, the problem is the main calculation is the only thing actually occuring once selected, and the user has to sit looking at a screen saying "calculating". Not even a moving "..."
To put it into perspective:
I have the same program in a seperate c++ file which is not windows forms - standard c++ that just does the calculation. It finished in about 5-10 mins depending on what the user inputs. In windows forms, it's been 2 hours and still running. I've checked the files it is writing to and I've found it's averaging at a shockingly low rate of calculation. Each result takes about 20 seconds, or more, whereas in the std c++ it's too fast to count per second! :D
Any ideas what I could check for, or any feedback on what you've found has helped with your program speed would be much appreciated!