[Lazarus] Using extensions for text file names .

Mehmet Erol Sanliturk sanliturk at ttnet.net.tr
Tue Jul 22 01:45:37 CEST 2008

On Sun, 20 Jul 2008 21:45:08 +0100
Martin Friebe <lazarus at mfriebe.de> 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.


More information about the Lazarus mailing list