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:
00172194
Views:
30
>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).

+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform