[Vm-dev] Object basicNew vs object shallowCopy

tim Rowledge tim at rowledge.org
Mon Aug 1 17:32:34 UTC 2016


> On 01-08-2016, at 12:58 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> 
> Hi John,
> 
>> On Jul 31, 2016, at 7:32 AM, John McIntosh <johnmci at smalltalkconsulting.com> wrote:
>> 
>> 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).
> 
> Thus only works to the extent that a particular kind if object us allocated all the time and to the extent that synthesizing an object is relatively expensive relative to filling in its slots.  This works for contexts above a complex object representation.  In my experience it doesn't work for floats either. But Cog does not allocate contexts often because of context-to-stack mapping and because the Spur object representation is simple, regular and very quick to synthesize (allocate).

Yeah but with a 64-bit address space we could pre-allocate *millions* of objects of every class! And speculatively initialise them!

Oh, wait; what do you mean we don’t have 17,592,186,044,416Mb ram in our Raspberry Pi’s yet?


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- A one-bit brain with a parity error.




More information about the Vm-dev mailing list