Why is Python so slow ?- revisited.

Thomas Wouters thomas at xs4all.net
Mon Jun 19 07:07:04 EDT 2000


On Mon, Jun 19, 2000 at 11:29:21AM +0100, Michael Hudson wrote:
> Thomas Wouters <thomas at xs4all.net> writes:

> > It won't matter a hoot in function calls, as all that happens string
> > literals in a void context is that they get added to the functions'
> > constants tuple (function.func_code.co_consts.)  And that happens at
> > compiletime (which can be at runtime, of course, if you use exec()
> > or import an uncompiled module, but if you do that often you
> > shouldn't whine about performance ;-)

> PyTrivia: isolated string constants are *not* added to co_consts,
> they're just dropped.

Indeed ! I specifically tested this, but must've botched it. I'd already
started wondering why string literals were added to co_consts, as it seemed
a waste ;)

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list