> in an application of mine occurs a lot of string separation and > re-concatenation. Since it is using masses of ANSI strings this is some > performance problem. > > The strings get stored and loaded from TStringList's and concatenated > by simply using '+' and separated with the function copy().
You could try to avoid repeated setlengths. However this would require two passes, something like tot:=0; for i:=0 to strlst.count-1 do inc(tot,length(strlst[i])); setlength(targetstring,tot); j:=1; for i:=0 to strlst.count-1 do begin move (targetstring[j],strlst[i]); inc(j,length(strlst[i])); end; > What I'd like to know is: What's are fastest ways of handling ANSI > strings? - avoid copying of strings if possible - operate on pchar level in speed dependant parts. > Since I'm not good at reading assembler code I have to ask ... and yes, > profiling is planned but not for tomorrow. ;) Posting more code would help too. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal