Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
X=y versus STORE y TO x
Message
 
À
07/07/2005 00:08:06
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01029522
Message ID:
01030284
Vues:
13
If I remeber well there is an article in Calvin Hsia's BLOG about STORE vs =. Unfortunately I can't find it now :o(. There he explain why STORE is fsster then [=]. It is because [=] has more operations to do. [=] operator must have logic to see if you want to STORE value to a variable or you want just to compare values.


>>I haven't used it for the same reason as you, readability. I think x=y is just easier to read. Do you have any idea as to why the STORE would be faster?
>
>I think it is time to actually do a speed test.
>
>
>clear
>looplimit = 1e6
>
>StartTime = seconds()
>for i = 1 to looplimit
>	store 10 to x
>next
>? [Using "store"], seconds() - StartTime
>
>StartTime = seconds()
>for i = 1 to looplimit
>	x = 10
>next
>? [Using "="], seconds() - StartTime
>
>
>On VFP 6, the version with STORE is consistently faster. The difference is not significant, IMO, except perhaps in some tight loops (store might use 0.3 seconds, and "=" 0.37 seconds, for a million repetitions).
>
>And no, I don't have the slightest idea why STORE would be faster.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform