[Vm-dev] SmallIntPair as immediate word

Eliot Miranda eliot.miranda at gmail.com
Wed Apr 10 15:05:40 UTC 2019


Hi Subbu,

> On Apr 9, 2019, at 9:44 AM, 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.

Yes, but not without losing the single bit tag tests the 64-bit VM uses now.  So doing this would reduce slightly the efficiencies of SmallInteger, Character and SmallFloat64.  And performance for these classes is much more important than making point devise more complex, in the image and in graphics plugins.

> 
> Has anyone tried to do this? It would save space and eliminate object alloc. But I am not sure about the overall performance hit.

I think these kinds of things don’t work well in practice.  And as Stephan points out we are two generations of display technology away from not being able to use such compact points to represent the entire display coordinate space.

At this stage it’s better to invest in more powerful and more general optimization strategies; ie Sista/Scorch.  With Clément leaving for google, hopefully only for a few years, I could do with competent help here.

> 
> Regards .. Subbu


More information about the Vm-dev mailing list