On Sun, 20 Jul 2008 21:45:08 +0100 Martin Friebe <[EMAIL PROTECTED]> wrote:
> In Synedit's PaintLines is a functioin called AddHighlightToken. > > At one point it copies the current token to the end of the TokenAccu. > At this point a remark can be found: > // Don't use AppendStr because it's more expensive. > > Instead of using AppendStr, it implements a plain "for i := 0 to ..." > loop, copying the content byte by byte. A simple for loop of a few iterations is always faster than a procedure call. And afaik AppendStr created a lot more overhead. > I am pretty sure (but would like to have that confirmed) that using > "move" would be even faster? Some years ago Move was slower than loops with a few iterations. Unless Move is now inlined, this is still true. > yes I could set up a test and profile it, but maybe someone already > knows how move performs vs for loops ? Every theory is grey. Only a real test gives you a clue. Mattias _______________________________________________ Lazarus mailing list [email protected] http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
