python performance

Syver Enstad syver-en+usenet at
Mon Sep 16 11:06:58 EDT 2002

loewis at (Martin v. Löwis) writes:

> Padraig Brady <Padraig at> writes:
> > > Calling functions adds overhead.  Running code within functions
> > > reduces overhead for object access.
> > 
> > Ah OK, this because it has to search a smaller namespace?
> No. Inside a function, local variables are accessed with integer
> indices, instead of by name. This is possible because there is static
> knowledge about the local variables in a function.
> > Wouldn't compiling overcome this? 
> Not if you want to preserve Python semantics; the compiler would need
> to emit code that performs the same actions that the interpreter
> currently does.

What about Psyco?


Vennlig hilsen 

Syver Enstad

More information about the Python-list mailing list