Python is slow?

David Cournapeau cournape at gmail.com
Fri Sep 26 05:45:14 CEST 2008


On Wed, Sep 24, 2008 at 3:07 AM, sturlamolden <sturlamolden at yahoo.no> wrote:
> On Sep 23, 3:44 pm, Robert Singer <rsinger at ____.com> wrote:
>
>> Well, python is not a number crunching language. However much we would
>> like it to be (we would ? :-).
>
>> No scripting language is.
>
> Not even Matlab, R, IDL, Octave, SciLab, S-PLUS or Mathematica?

I am fairly experienced in matlab (have been using it extensively for
5 years in academical context), and now with numpy, and generally,
they are comparable speed-wise. Matlab has some niceties which makes
it faster in some simple cases (JIT for loops, function calls faster,
sometimes COW semantics means it faster), but numpy (at its core at
least) is much more powerful IMHO. Also, matlab is horrible when you
want to interface some C to it (the C api is basically broken; in
particular, there is no way to gurantee you won't leak memory when you
Ctrl+C custom C extensions because the C api does not have facility to
deal with signals). I totally gave up matlab for numpy 2 years ago,
and never regretted it.

I think speed is not the issue when comparing matlab, R and co.
Availability of functionalities matter much more. R is quite hard to
beat if you need to do advanced statistics, specially since it is the
tool of choice for most academic statisticians. I hope numpy/scipy
will be there sometime, but it is honestly still quite far in that
domain.

cheers,

David



More information about the Python-list mailing list