Bill Dortch wrote:
On 10/20/07, *Bill Dortch* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Might it have something to do with the reference to self in the call?
...
 This appears to be at least part of the story. If I change:
...
to:

  def benchmark_attr_get
    ...
    self.a; self.a; self.a; ...
    ...
  end
...
100k * 100 attr gets (a;), 1 ivar 2.703000 0.000000 2.703000 ( 2.703000) 100k * 100 attr gets (self.a;), 1 ivar 5.234000 0.000000 5.234000 ( 5.234000)

Yes, this seems in line; the reference to self is necessary in the attr set test because "a = " is *always* a local variable set. attr sets *must* be fully qualified.

Even stranger, the self. reference is slower than accessing an attr in a separate object (x):

100k * 100 attr gets (x.a;), 1 ivar 3.922000 0.000000 3.922000 ( 3.922000)

Curious, no?

Quite. I'm looking at it now.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to