Accessing variables through sending messages
Andreas Raab
andreas.raab at gmx.de
Tue Jun 21 21:38:19 UTC 2005
Colin Putney wrote:
> I haven't seen Alex's code, but 1000x doesn't sound far fetched. If he's
> using #instVarNamed: it's more than just sending an accessor. It's a
> send with a full activation, which does several more full sends to ask
> the class for the names of its instance variables, iterate over them
> checking for equality, then call the primitive to fetch the value based
> on index. Slooow.
Oh. Yes. #instVarNamed: ... oh dear. Yes, I see how this would be a
1000x slower ;-)
> I'm liking the sound of Tweak's approach here. I imagine it's the kind
> of thing that Exupery could optimize nicely, so it could perform very
> well, but it would also be more dynamic than the current offset-based
> system.
Depends on how well Exupery does adaptive inlining. But if I had the
choice I'd opt for more send performance before dealing with adaptive
inlining - with an average of 300 cycles per send there is a lot of room
for optimizations and optimizing sends in general would help out many
other areas.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|