Information générale
Catégorie:
Codage, syntaxe et commandes
>>>Amazing!! So why isn't anything internal to FoxPro able to do it that fast?
>
>I suspect performance difference is not just lack of System.Collections.Generic's Reverse method in VFP, but exponential inefficiency as the lengthening result string keeps requiring a new block of memory. It might be interesting to try concatenating into a memo field with Block Size set to (say) 10 (=5120 bytes) to see whether that speeds it up by allowing concatenation in place. If I had time I'd also experiment with a result string of correct length- even the original source string- with words STUFFed into it in place.
Quite up thread I wrote about the problems vfp will run into on very long strings and huge numbers of concats.
If you KNOW that your data will have such items, one of the fastest AND easiest to read things is to pipe into a fOpened() file, as the strings accumulate in the buffer, writes sometimes are offloaded to system routines. Counterintuitive to use a file instead of memory, but for vfp memory (if talking huge amounts) certainly true. If strings get large and # of operations low, marshalling across COM into file opened with Scripting host beats vfp F-functions...
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement