Python 2 times slower than Perl

Johann Hibschman johann at physics.berkeley.edu
Wed Jul 18 16:30:52 EDT 2001


John J Lee writes:

> When do you ever write Python code that does this kind of thing??  For
> example, if you're doing lots of fp work, don't you use Numeric?

I don't, really.  If I have to do this, I write a C module and do it
there, but it's a PITA.  If I could find some way to write decent-
speed numerical integrators (say) in pure python, then I'd do it.

If I could just write my entire code in, say, OCaML or Common Lisp,
rather than in a mixture of C++ and Python, then I'd be very happy.

Numeric only helps with half the problem, since I do more
integration/function evaluation than I do matrix math.

That being said, I find python a great tool that is fast enough, once
I move speed critical parts out to C++.  However, the less I move to
C++, the happier I am.

And ignore my numbers for python.  I discovered that the version of
python on my laptop wasn't compiled with -O2, so the run time was
artificially high.

-- 
Johann Hibschman                           johann at physics.berkeley.edu



More information about the Python-list mailing list