Adding a new imediate type
Yoshiki Ohshima
yoshiki at squeakland.org
Wed Jan 11 04:57:04 UTC 2006
Hello,
> instantiateSmallClass:sizeInBytes:fill:.
>
> All it needs to do, is grab some memory then populate it. That's a
> fairly short sequence, so long as a GC isn't necessary. The speed gain
> will be from specialising the entire primitive for the case where a GC
> isn't needed. It's more code, and more special cases, but still
> probably easier than creating new intermediates.
This is *not* related to Point creation, but I once proposed to have
a object creation primitive for non-pointer objects that doesn't
zero-out the content, but just "grab" some memory.
For methods like String>>copyReplaceFrom:to:with: and such, this can
give 30% or so improvement. Also, the primitive 105 seems to handle
it properly (i.e., fails) when the content of a non-pointer object is
copied over to a pointer object. So, it should be "safe enough".
The novice users shouldn't use it casually, but for people who need
such performance gain, it would be convenient to have.
-- Yoshiki
More information about the Squeak-dev
mailing list
|