PyOpinion: Does Python Programming Marginalize You?

Bijan Parsia bparsia at email.unc.edu
Thu Jun 8 01:37:04 EDT 2000


Ken Seehof <12klat at sightreader.com> wrote:

[snip]
> Because of it's dynamic nature, Python simply can't be optimized all that much
[snip]

A common misunderstanding. Python is no more dynamic than Smalltalk (and
several others languages). I'm perfectly willing to bet that, for
example, a method cache would speed lookups enormously. This is hardly a
difficult or novel technology. Once we start talking Self/Hotspot stuff
the possible gains are higher.

IIRC, Python 1.5 approximate doubled the speed of Python 1.4. But surely
Python 1.4 was no *less* dynamic that Python 1.5! So why couldn't one
expect further doublings?

(Of course, there may be *implementation* details, like avoiding certain
complexities in the VM, embedding the interpreter issues, and making C
extentions simple, which make various sorts of optimizations undesirable
and that, for it's user base, that's ok.)

Heck, it just might be that average appication speed is better served by
strategic C extentions rather than improving dispatching. If you have a
lot of C modules (as Python does) and a large group of C programmers
churning them out (as Python does), it may be the case that *most*
typical programs end up in C code for critical stuff anyway.

Of course, the lack of speed *encourages* writing code that is more
likely to avoid dispatch cost, etc.

Er...but my main point is that dynamic nature alone doesn't entail
"pure" Python's "slowless". Whether you feel you have to apologize for
this is up to you :)

-- 
Bijan Parsia
http://monkeyfist.com/
...among many things.



More information about the Python-list mailing list