[Pythonmac-SIG] two-level namespaces enabled?

Kevin Altis altis@semi-retired.com
Thu, 2 Jan 2003 12:04:47 -0800


Bill Bumgarner has been porting some of my PythonCard sample code to work
under PyObjC. Yesterday I sent him the life sample code cut down to just the
pure Python calculation of each generation. Basically, the "grid" is just a
dictionary of (x, y) tuples with values of either 0 or 1. No Mac libs,
floating point, disk i/o, etc. is involved in the loop that I timed.

Anyway, I ran it with both the Jaguar Python (/usr/bin/python) and the
MachoPython 2.2.1-4 disk image (/usr/local/bin/python) at:

http://sourceforge.net/project/showfiles.php?group_id=10718

and there was a 10% speed difference on the same box. I asked Bill for an
explanation and he suggested...

> From: Bill Bumgarner
>
> On Thursday, Jan 2, 2003, at 00:10 US/Eastern, Kevin Altis wrote:
> > I was a bit surprised when I ran the cmdLife.py program on my Mac.
> > /usr/bin/python (Apple) takes 38.8 seconds pretty consistently and
> > /usr/local/bin/python (2.2.1 framework build) takes roughly 43.3. Not
> > sure what that means, but it is a 10% difference.
>
> In any case, this is likely because the Framework build is not built
> w/two level namespaces enabled and, as such, is causing an extra
> indirection when dispatching calls into other frameworks [or something
> like that].
>
> The Apple build definitely had two-level namespaces enabled and is also
> a static build, so no indirection is involved.

I can send the code to anyone that is interested, but I bet it would
probably be more useful to simply run Python through its test suite and see
how the numbers compare on both versions in case this would have any impact
on the 2.2.2 and/or 2.3 builds people are working on.

ka
---
Kevin Altis
altis@semi-retired.com
http://radio.weblogs.com/0102677/