Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The other way around
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00385262
Message ID:
00385320
Vues:
16
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform