<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 01/21/2016 01:11 AM, Sven Barth
wrote:<br>
</div>
<blockquote
cite="mid:CAFMUeB-4ppxZ5KPaYowCPeNa90fP1LDQ2xrVo1MwmPq5k9+KmA@mail.gmail.com"
type="cite">
<p>Am 20.01.2016 19:26 schrieb "Graeme Geldenhuys" <<a
moz-do-not-send="true"
href="mailto:mailinglists@geldenhuys.co.uk"><a class="moz-txt-link-abbreviated" href="mailto:mailinglists@geldenhuys.co.uk">mailinglists@geldenhuys.co.uk</a></a>>:<br>
><br>
> Is there a performance difference between using bitmask
values and sets?</p>
<p>For sets with <= 32 elements it should behave the same if I
remember correctly (I don't know right now though whether it
would be 64 elements on 64-bit platforms though). With more
elements there will be a penalty as then helper routines are
needed.<br>
You cam check this by compiling with -al and comparing the
assembler code. :)</p>
<p>><br>
> While we are on the topic of Sets. What is the maximum
number of values<br>
> you may have in a set, and does it differ between 32-bit
and 64-bit<br>
> platforms?</p>
<p>The maximum is currently 256 and it's the same on both
platforms.</p>
</blockquote>
I think you can have even larger sets, but they are not supported by
the RTTI functions and the FCL streaming system. Also, if you are
using sets larger than 32 elements, the default value for {$packset}
is not very optimal, as it will waste space for 256 elements, even
if you need only 33. So, you're better off using something like
{$packset 4}. The default setting is only kept for backward
compatibility.<br>
<br>
Nikolay<br>
</body>
</html>