Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Benchmarking VFP for string processing.
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00172131
Message ID:
00172210
Views:
32
>>Along the same lines, the test where you pass the string by reference really doesn't apply either. What you're measuring there is both the mechanics connected with parameter passing and string manipulation. In general, passing strings by reference is always going to be more efficient than passing them by value, with the exception of 1-3 byte strings. You'll find that when passing strings by value, the length of time connected with passing the parameter is directly connected with the length of the string. When passing by reference, this doesn't come into play.
>
>
>Oh but it does. If you change his example to:
>
>LPARAMETER lcString
>RETURN lcString
>
>passing the value by value to be added - It's still way faster than the call by reference! Even doing:
>
>
>LPARAMETER lcString
>lcString = lcString + "aslkdjalsdjas"
>RETURN lcString
>
>is still faster.
>
>The thing is that the ByRef call can't be optimized by the new string
>functions, because it's a different variable. Passing values in and
>out apparently is very fast (which seems strange, but that's how it
>is).
>

Hi Rick,

Hate to disagree (especially without doing any testing), but I'll have to check this. I simply can't imagine how a copy of the value to be passed can out perform a simple reference to it.

Of course, I may be way behind the times here, but I'd still like to check for myself.

Thanks, I'll get back to you.
George

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

Click here to load this message in the networking platform