[ann] Minimal Python project

Edward K. Ream edream at tds.net
Tue Jan 14 17:41:46 CET 2003


> I put the Python version of the function back into my application and
set Psyco loose on it, I was shocked to find it performing more than 2x
faster than the C version. I had to investigate...

> What I concluded was that Psyco does have access to more information at
runtime than a compile-time optimizer.


> So in my real world case, Python code with Psyco was faster than the
equivalent code in C. That's not to say that a faster alternative
couldn't be created in C, but that a faster version in C wouldn't have
been created because it would have required significantly more time
spent profiling and analyzing code (after already spending significantly
more time writing the code in the first place).

Many thanks, Jimmy, for this detailed and fascinating report.  I shall put
this day down in my diary as the day that everything I may have known about
"speed" changed, very likely forever.

> Just imagine someone someday saying: C is fine for most of your
programming tasks, but for those time critical tight inner loops you
should use Python for performance reasons. Statically typed code just
can't be optimized for performance the way dynamically typed code can
be. :)

How excellent :-)  Why would anyone ever use C at all, except to bootstrap

Thanks so much to all who have born with me through all this discussion.  I
feel like I've learned something vitally important in the last several days.


More information about the Python-list mailing list