[SciPy-Dev] Sparse compressed major axis slicing with sequence is slow

Eric Martin eric at ericmart.in
Sat Mar 21 02:20:06 EDT 2015


Hi,

I filed https://github.com/scipy/scipy/issues/4573 a few weeks ago and am
still waiting for some contact from someone involved with Scipy development
that this work is wanted. I recommend reading the issue, but the summary is
that slicing a compressed sparse matrix along the major axis with a
sequence is quite slow.

My method offers about a 100x speedup when selecting only a small number of
rows/columns, and causes a bit of a slowdown if selecting many rows (but
perhaps this slowdown could be limited with more development time). I also
observed that the compressed sparse matrix initialization takes a large
amount of time validating input data.

I'd really appreciate some feedback on things like

(1) is it OK if the code takes 2 different paths depending on input size
(based on speculation of which would be faster)?
(2) can I add code paths for compressed matrix initialization that skip
input data sanity checks?

before I take the time to make a PR.

Thanks a ton,
Eric Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20150320/d5d08abf/attachment.html>


More information about the SciPy-Dev mailing list