Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Faster execution
Message
De
03/12/2005 10:19:56
 
 
À
03/12/2005 09:31:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01074569
Message ID:
01074577
Vues:
15
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform