syver-en+usenet at online.no
Mon Sep 16 11:06:58 EDT 2002
loewis at informatik.hu-berlin.de (Martin v. Löwis) writes:
> Padraig Brady <Padraig at Linux.ie> 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?
More information about the Python-list