Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
X=y versus STORE y TO x
Message
From
07/07/2005 00:08:06
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01029522
Message ID:
01029817
Views:
15
>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.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform