Python IS slow ! [was] Re: Python too slow for real world
Christian Tismer
tismer at appliedbiometrics.com
Fri Apr 30 04:11:54 EDT 1999
Terry Reedy wrote:
>
> In article <slrn7ieipq.8uk.wtanksle at dolphin.openprojects.net>,
> wtanksle at dolphin.openprojects.net says...
>
> >The reason it's slow is its runtime model. _Every_ function call requires
> >a lookup in a hash table, just on the off-chance that the programmer
> >changed the meaning of the function.
>
> A batch-mode optimizer analyzing an entire file (module) should be able to
> detect whether or not function names are rebound.
>
> Perhaps module bindings should be considered immutable from outside the
> module unless explicitly declared otherwise. (This would of course require a
> new keyword and would break the rare existing code that does this until the
> new directive was added.)
I'm thinking of no new keyword, but a mechanism which
allows me to lock a namespace somehow. At the end of a
library module, this function could be called for the module,
and all functions would be bound to a special table.
I would also like to be able to do this with functions
and classes. A function would be modified by resolving
all identifiers once. For classes, I would do a similar
snapshot, which would collect once every function/method which
can be seen by inheritance.
This is of course a semantic change, but it is an option
for people who know the implications. There is no need
for a library module to be slow, if it just suffers from
flexibility.
ciao - chris
--
Christian Tismer :^) <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH : Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101 : *Starship* http://starship.python.net
10553 Berlin : PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF
we're tired of banana software - shipped green, ripens at home
More information about the Python-list
mailing list