[fpc-pascal] bitmask vs sets. Is there a performance difference?
Sven Barth
pascaldragon at googlemail.com
Mon Jan 25 16:23:23 CET 2016
Am 25.01.2016 12:36 schrieb "Graeme Geldenhuys" <
mailinglists at geldenhuys.co.uk>:
>
> On 2016-01-20 23:11, Sven Barth wrote:
> > You cam check this by compiling with -al and comparing the assembler
code.
>
> It seems using Sets produce slightly smaller assembler code (2
> instructions less) for the example code I posted. Attached is a
comparison.
>
> I guess the other benefit is that using Sets is more "pascal like" and
> probably easier for more developers to understand.
In theory the compiler could optimize the non-set code... I don't know
whether the compiler is currently indeed capable of doing so though. Did
you test with different optimization settings?
Anyway I agree that sets are easier to read ;)
Regards
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160125/4f10d2af/attachment.html>
More information about the fpc-pascal
mailing list