Python unsurprisingly has a huge overhead for double precision
function evaluation. If you have a fast compiled version at hand, you
can of course use that with the mpmath plotting functions instead (and
maybe fall back to mpmath for the unsupported cases).
It's possible to get some decent speedups on this kind of code with
psyco and pypy (you'll need a recent svn checkout of both mpmath and
pypy), but probably not close to C/C++/fortran. The fp versions of
some special functions in mpmath would be reasonable candidates for
adding optional Cython type annotations though, if anyone has an
interest in that.
When I need to plot mpmath functions, I usually just settle for a
smaller number of points until I find something interesting enough to
render at a higher resolution. 5000-10000 is usually sufficient to see
the features of a function (though not very pretty).
Fredrik
It's hard to beat f77 though, that's for sure. We should also probably
update mpmath in sympy (I don't know if that is an issue with regards
to speed).
Ondrej