On Fri, May 27, 2005 at 01:49:00PM -0400, Tim Peters wrote:
> Nope, it's a "cell" reference to an enclosing scope, and gets looked
> up at cell-dereference speed. In my experience, that's generally a
> bit slower than accessing a module global. That may have to do with a
> quirk of MSVC's code generation; unsure.
Wow. If so, gcc apparently shares the same quirk.
With python 2.3.5 on my ancient gentoo box,
I get this (after substituting time.time for time.clock):
This is so suprising to me that I went ahead and tried
a couple of variations that I figured *must* be slower:
# Doesn't get much simpler than this.
# ok this one is pretty silly
_marker = object()
def lookup5(self, arg):
lookup5 = C().lookup5
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -