[ann] Minimal Python project

Chad Netzer cnetzer at mail.arc.nasa.gov
Sat Jan 11 01:14:37 CET 2003


On Friday 10 January 2003 15:37, Edward K. Ream wrote:
> > As Armin Rigo of PSYCO fame takes part in the effort,
> > we are confident that MinimalPython will eventually
> > run faster than today's CPython.

> I am inclined to disbelieve this claim.  Why should Psycho be able to
> do better than an optimizing C compiler applied to hand-written
> interpreter code and/or library code?

Perhaps because the hand-written code is not tuned for speed, and not 
easily optimized by a C compiler for ultimate speed.  The Python code 
makes a number of clever optimization regarding memory allocation and 
other issues, but in general, it goes for straightforward, portable 
design, rather than lots of fancy optimization tricks.

Someone trying to make the fastest C version possible of Python, may be 
able to do much better, but it could be a lot of work (and in 
particular, may require converting a lot of existing Python code into 
C), without being more maintainable or portable.  Currently, a LOT of 
the Python Library is implemented in Python, not C.

> Would anyone care to enlighten me how MinimalPython will achieve its
> stated goals?

Take a look at Psyco.  It tries to produce faster runtime code based on 
evaluation of runtime characteristics.  Ie. it specializes at runtime, 
rather than compilation.  This is a whole different class of optimizing 
than C compilers are traditionally doing, and has had some good results 
(apparently) so far.

So whether or not the new project will be faster than CPython, I don't 
know.  But there is ample evidence to suggest that the claim that it 
could be faster, is not hollow.

http://psyco.sourceforge.net/introduction.html

-- 
Bay Area Python Interest Group - http://www.baypiggies.net/

Chad Netzer
cnetzer at mail.arc.nasa.gov





More information about the Python-list mailing list