pyvm -- faster python

Paul Rubin http
Thu May 12 15:25:17 EDT 2005


François Pinard <pinard at iro.umontreal.ca> writes:
> Deep down, why or how not having a [traditional, to-native-code]
> compiler is a deficiency for CPython?  We already know that such a beast
> would not increase speed so significantly, while using much more memory.

I'd say the opposite.  The 4x speedup from Psyco is quite significant.
The speedup would be even greater if the language itself were more
compiler-friendly.

> So far, it seems that the only way to get speed is to attach static
> type information to some variables.  

No of course not, there's quite a bit of overhead in interpretation in
general.  Plus, having to do a dictionary lookup for 'bar' in every
call like foo.bar() adds overhead and I don't think I'd call fixing
that as similar to adding static type info.

> Some compilation avenues do it through information added either in
> Python source code or in extraneous declarative files, other
> approaches do it by delaying compilation until such information is
> discovered at run-time.

Also, lots of times one can do type inference at compile time.

> The former taints the purity of real CPython as the only source.

I don't understand this.  What purity?  Why is real CPython the
only source?  There are dozens of C compilers and none of them is
the "only source".  Why should Python be different?



More information about the Python-list mailing list