Python execution speed

Chris Barker chrishbarker at
Wed Nov 21 22:35:18 CET 2001

Peter Hansen wrote:
> The usual approach is simply to profile the
> code and recode the "hot spot" in C.

This is a problem, not a solution! Most of the code I write is in Python
and it is "fast enough", but not all. And while I end up having to write
only little bits in C, those little bits take me a whole lot longer than
a large bits of Python code. Part of the problem for me is that I am not
very fluent in C, but that is the point, you should not have to be
fluent in C to use Python effectively. I also now have to distribute a
compiled library with my code, or presume all my users have compilers.

Given the other options, I still think Python is worth it, but it would
still be a much greater language if you could get it to run as fast as
C! Frankly, if the organization I work for was at all open to it, I'd
give LISP  shot: the dynamiscm and the speed...pretty tempting!

BTW, if it wasn't for NumPy, I could only use Python for little scripts,
it would be just too slow for most of what I do (A lot of numerics).


Christopher Barker,
ChrisHBarker at                 ---           ---           --- ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------

More information about the Python-list mailing list