Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memory Pre-Allocation Trick?
Message
De
12/11/2002 21:42:09
 
 
À
12/11/2002 20:34:46
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00721182
Message ID:
00721957
Vues:
29
>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform