Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory Pre-Allocation Trick?
Message
From
12/11/2002 21:42:09
 
 
To
12/11/2002 20:34:46
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00721182
Message ID:
00721957
Views:
28
>>There may be another downside...
>>
>>A 1 million times loop of your 2 samples too:
>>
>>- string concatenation: 9.332 seconds
>>- TEXTMERGE sequence: 45.210 seconds
>>
>>I think that the difference makes it worth thinking about before wholeheartedly adopting the TEXTMERGE method.
>
>I've repeated this test with different levels of complexity (namely, number of variables and string concatenations), and the result is not exactly 5:1, more like 3:1, but it does confirm your finding.
>
>At least, Textmerge method is easier to maintain - you see just the text and the insertable pieces; with string concatenation you get long expressions with chunks of text here and there. I've maintained code which had dozen lines of string concatenation here and there, and it was so easy to get lost in it. Converting that to textmerge maybe lost a few milliseconds, but saved long minutes in maintenance.

I agree. In most of my cases TEXTMERGE would be perfectly suitable.

I was more thinking of the original intent of this thread - to 'optimize' VFP code - and so felt compelled to mention this aspect.
Previous
Reply
Map
View

Click here to load this message in the networking platform