[SciPy-User] scipy.sparse vs. pysparse

Pauli Virtanen pav@iki...
Tue Sep 27 11:36:49 CDT 2011


27.09.2011 17:35, Tony Stillfjord kirjoitti:
> Is there a lot of overhead in the scipy.sparse function calls, or is
> there some other reason that scipy performs
> so much worse for "small" matrices? I realise that if you have a small
> enough matrix you could just as well have
> it be dense, but the point where scipy starts to break even with
> pysparse is quite far from the size where I would
> switch to the sparse format.

Thanks for drawing attention to this. Yes, a quick profile run shows
that there is a lot of overhead in scipy.sparse.

However, a quick look reveals that most of it is probably unnecessary,
and with small changes, it should be possible to speed it up by a large

Laundry list, is someone wants to get to work:

- Optimize `sputils.upcast` -- e.g. memoization etc. -- it takes a lot
  of time, and is called often.

- There should be no reason to use `sputils._isinstance`, just use the
  builtin isinstance() everywhere.

- Arrange a fast path for arrays that need no conversion etc. in

More information about the SciPy-User mailing list