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:
00172239
Views:
33
>>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 again Rick,

After I first replied, I wondered if I were missing something. Perhaps I still am, and if so, I trust you'll clarify the above a bit. I read the above as saying that when passing by value, the length of the string doesn't come into play. Yet when I ran some tests, it apparently does. One of the things that I noted was that passing by value wasn't slower than passing by reference until the number of characters was greater than 8. Further, as the length of the string increased, so did the amount of time required to process the function call.

Comments?
George

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

Click here to load this message in the networking platform