Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Faster execution
Message
From
03/12/2005 10:19:56
 
 
To
03/12/2005 09:31:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01074569
Message ID:
01074577
Views:
16
>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

&& faster

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
Previous
Reply
Map
View

Click here to load this message in the networking platform