[Vm-dev] Re: Immutability, newspeak (was: Vm-dev post from jbaptiste.arnaud@gmail.com requires approval)

Eliot Miranda eliot.miranda at gmail.com
Wed Jun 9 17:35:59 UTC 2010


On Wed, Jun 9, 2010 at 10:25 AM, Igor Stasenko <siguctua at gmail.com> wrote:

>
> On 8 June 2010 19:15, Andreas Raab <andreas.raab at gmx.de> wrote:
> >
> > On 6/8/2010 7:41 AM, David T. Lewis wrote:
> >>
> >> What do the VM developers think with respect adopting the VM changes?
> >> The immutability bit is a scarce resource. Is it OK to allocate it
> >> for this purpose or are there likely to be other projects interested
> >> in using it for other reasons?
> >
> > Honestly, I don't thinnk the immutability bit carries its weight here.
> > There's some fun stuff you can do with it, for sure, but outside of
> > *extremely* specialized applications (oodbs) there will be little to no
> use
> > for it. At least I don't see where you'd make use of immutability in some
> > random app that's not a database. If it were essentially free to add it,
> I
> > wouldn't mind (like I said there's fun stuff that one can do) but given
> that
> > we're talking about allocating a header bit I feel that there's just not
> > enough mileage we get out of it...
> >
> > Just my random $.02.
> >
>
> my $.001
> my concern is not a header bit, but introduction of its check on each
> write operation,
> which will slow down things.
>

My experience in VisualWorks and Newspeak was that the total cost was in of
the order of a < 5% slowdown over a broad range of benchmarks.  The cost is
this small because at least for pointer writes (which includes inst var
writes) there is already an expensive store check and adding a few more
instructions which access data header data that is almost always already in
the cache is a small additional cost.  The relative cost is also small for
array writes because of the cost of the bounds check.

best
Eliot

P.S. with clever coding the check can be folded into the bounds check for
pointer array writes.  The trick is to include the immutable bit into the
inst size calculation so that compact header immutable arrays look as if
they have no indexable fields because including the immutable bit makes it
look like they have a lot of named inst vars.


> > Cheers,
> >  - Andreas
> >
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100609/3fa14e15/attachment.htm


More information about the Vm-dev mailing list