[Python-Dev] Python is faster than C

Tom Emerson tree at basistech.com
Mon Apr 5 10:36:26 EDT 2004


Moore, Paul writes:
> Hmm. I'm torn. On the one hand, it's really cool that Python+Psyco can
> out-perform C (another argument against the knee-jerk "recode bits in
> C" reaction). But my gut feel is that not enough people use Psyco to
> make this a good answer yet. On the third hand, if we recode chunks of
> the stdlib in C, do we kill too many chances for Psyco to work its
> magic?

If I understand correctly, the issue is that when stdlib functions are
rewritten in C, they end up being faster but are still slower than
Psyco optimized code because they are still polymorphic while the
Psyco'ized generates multiple paths.

If that is the case then one could certainly hand-hack the C
implementations to expand common code paths in an optimal way.

    -tree

-- 
Tom Emerson                                          Basis Technology Corp.
Software Architect                                 http://www.basistech.com
  "Beware the lollipop of mediocrity: lick it once and you suck forever"



More information about the Python-Dev mailing list