[fpc-pascal] Which comparisons are faster?

Krzysztof dibo20 at wp.pl
Thu Dec 13 23:18:31 CET 2012


Thank you very much :)


2012/12/13 Mattias Gaertner <nc-gaertnma at netcologne.de>

> 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
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20121213/d66d02d4/attachment.html>


More information about the fpc-pascal mailing list