>I have an app that does thousands of calculations. I would like to see it run faster. Does anyone have any speedup tips to pass along to the VFP community?
>
>And . . . Does a class execute any quicker than a prg?
globally
- use m. prefix
- use with/endwith
with objreference && when accessing an object more than once or twice
.value = 123
abc = .property
endwith
For code that is executed many times
- reduce the number of calls
- reduce the number of statements (at the cost of readability)
- avoid string variables, if you have chars replace them with integer variables
- cut variables that are only used a few times, eg
for i = 1 to ....
n = m.i + 5
result = m.i * m.n
endfor
for i = 1 to ....
result = m.i * (m.i + 5)
endfor
use the coverage profiler to find the bottlenecks
Try to do things another way that is faster
I wouldn't be surprised if you were able to cust down the execution time to 30% (not by 30%)
Gregory