[Vm-dev] SmallIntPair as immediate word
K K Subbu
kksubbu.ml at gmail.com
Wed Apr 10 03:23:26 UTC 2019
On 10/04/19 12:44 AM, Tobias Pape wrote:
>
> Hi Subbu,
>
>
>> On 09.04.2019, at 18:44, K K Subbu <kksubbu.ml at gmail.com> wrote:
>>
>> All,
>>
>> Squeak release image contains around 15k Points with none using
>> more than 24 bits per coordinate.
>>
>> On 64-bit machines, it should be possible to pack two integers of a
>> pair into a single immediate word - 30+30.
>>
>> Has anyone tried to do this? It would save space and eliminate
>> object alloc. But I am not sure about the overall performance hit.
>>
>> Regards .. Subbu
>
> I'm _really_ interested how you arrived at those numbers. Can you
> share the code for your analysis?
Squeak 5.2 (Linux 64b) #18231
{Point. Fraction} collect: [:c | c allSubInstances size]
#(12118 32)
Point allSubInstances select: [ :p | (p x >= (2 raisedTo: 24)) or: (p y
>= (2 raisedTo: 24))]
an OrderedCollection ()
Fraction allSubInstances select: [ :p | (p numerator >= (2 raisedTo:
24)) or: (p denominator >= (2 raisedTo: 24))]
an OrderedCollection ()
Regards .. Subbu
More information about the Vm-dev
mailing list