[Vm-dev] Object basicNew vs object shallowCopy

John McIntosh johnmci at smalltalkconsulting.com
Sun Jul 31 14:32:33 UTC 2016


So has anyone thought about pre-allocating a few commonly used objects during idle time?  Then grabbing that object and filling in the actual details when one is needed. The Squeak VM did that for method context (and recycled them).

Also a decade back I looked at the new logic and rearranged the code to fast path the creation of commonly used objects. This improved things a bit but didn't really outweight the resulting mess of if statements 

Sent from my iPhone

> On Jul 31, 2016, at 08:45, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> 
> Hi Denis, Hi Levente,
> 
>> On Jul 31, 2016, at 3:41 AM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
>> 
>> It can't be quicker than basicNew.
> 
> Depends. Decoding size and encoding header from the class receiver in basicNew might be slower than decoding size and encoding header from the instance receiver in shallowCopy.  But the difference should be small.
> 
>> It will be quicker than basicNew + manual copying of the fields.
> 
> Agreed.
> 
>> And yes, this is quite important to be quick along with the #copyFrom: primitive (168).
> 
> It's on the to do list then :-)
> 
>> Levente
> 
> _,,,^..^,,,_ (phone)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2647 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160731/61e34921/smime-0001.bin


More information about the Vm-dev mailing list