[ENH][VM] primitiveCopyObject

ducasse ducasse at iam.unibe.ch
Sat Dec 6 11:55:56 UTC 2003


hi andreas and other VM maintainers,

How do we proceed with BFAV, one of you collect, approve the 
submissions?

Stef
On Vendredi, déc 5, 2003, at 21:29 Europe/Zurich, Andreas Raab wrote:

> Change Set:		CopyObject
> Date:			5 December 2003
> Author:			Andreas Raab
>
> Introduces a primitiveCopyObject which can be used for (shallow) 
> copying
> state from some other object of the same class. This allows for 
> efficiently
> 'backing up' and 'restoring' state in some object. For example, one 
> can use
> a #clone of the object to get a backup and then use #copyFrom: to 
> restore
> the backup.
>
> A benchmark (using PasteUpMorph) shows that the primitive is about 60 
> times
> faster than the existing method:
>
> m := PasteUpMorph new.
> [1 to: 100000 do:[:i| copy := m clone. m copyFrom: copy]] timeToRun.
>
> Without primitive:  7055 msecs
> With primitive:      119 msecs
>
>
> <CopyObject.2.cs>




More information about the Squeak-dev mailing list