Is a "real" C-Python possible?

Diez B. Roggisch deets at nospam.web.de
Sun Dec 9 16:41:52 EST 2007


Jack schrieb:
> I understand that the standard Python distribution is considered
> the C-Python. Howerver, the current C-Python is really a combination
> of C and Python implementation. There are about 2000 Python files
> included in the Windows version of Python distribution. I'm not sure
> how much of the C-Python is implemented in C but I think the more
> modules implemented in C, the better performance and lower memory
> footprint it will get.
> 
> I wonder if it's possible to have a Python that's completely (or at
> least for the most part) implemented in C, just like PHP - I think
> this is where PHP gets its performance advantage. Or maybe I'm wrong
> because the core modules that matter are already in C and those Python
> files are really a think wrapper. Anyhow, if would be ideal if Python
> has performance similar to Java, with both being interpreted languages.

Writing everything in C might be possible - but is a daunting task & not 
justified by the results. And wherever the standard libraries make use 
of the flexibility of Python, it's questionable if there really was any 
performance gain at all.

But what REALLY is questionable is the alleged performance advantage - 
how do you back that up? According to the well-known (and surely 
limited) computer language shootout

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all


Python is roughly 25% faster than PHP. Granted, this is just one 
benchmark, with questionable real-life relevance. But where do you get 
the impression from that PHP is faster than Python then?

diez



More information about the Python-list mailing list