Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The other way around
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00385262
Message ID:
00385320
Views:
15
>Hi George,
>
>I've run a number of tests now and agree with your conclusion.
lcresult = SUBSTR(lcfoo, lni, 1) + lcresult
is faster than
lcresult = lcresult + SUBSTR(lcfoo, lni, 1)
The iteration structure doesn't seem to have an affect.
>In any case, they are both FAST!

Oh yeah. If the truth be known, I was just being a wise guy with my buddy John. That was the reason for my original post.

On the serious side of this, personally, given what's going on, I, quite frankly can't see any reason for one being faster than the other. In fact, I'm rather surprised at the result. About the only thing that makes any sense here is that in case 1 (lcresult = lcresult + SUBSTR(lcfoo, lni, 1) that there is more memory management to be done. IOW, the amount allocated for the string has to be changed and stored. In case 2 (lcresult = SUBSTR(lcfoo, lni, 1) + lcresult), it may be that a new area of memory is used and the pointer simply switched. This, however, a big time SWAG and it could very well be something else.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform