[fpc-pascal] Which comparisons are faster?

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Dec 13 22:48:09 CET 2012


On Thu, 13 Dec 2012 22:32:06 +0100
Krzysztof <dibo20 at wp.pl> wrote:

> Hi,
> 
> I know that in normal cases those things has no matters, but I do much
> things in OnPaint so each millisecond is matter. For example, strings
> comparisons:
> 
> What is faster if string is "big":
> 
> if s<>'' then....
> 
> or:
> 
> if Length(s)>0 then...

The first.

 
> Same thing with incrementations:
> 
> i := i + 1
> 
> or:
> 
> Inc(i)
> 
> or:
> 
> i += 1;

All the same.

Mattias



More information about the fpc-pascal mailing list