From: tismer at appliedbiometrics.com (Christian Tismer)
Date: Fri, 30 Apr 1999 08:11:54 GMT
Subject: Python IS slow ! [was] Re: Python too slow for real world
References: <613145F79272D211914B0020AFF6401914DAD8@gandalf.digicool.com>
		<p5g15lmb35.fsf@bidra241.bbn.hp.com>
		<slrn7ieipq.8uk.wtanksle@dolphin.openprojects.net> <7g9qmo$luf$1@news.udel.edu>
Message-ID: <372965CA.2B3FD2FE@appliedbiometrics.com>
Content-Length: 1845
X-UID: 547                                                  


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




