-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: sparse: speedup LIL matrix slicing #3338
Conversation
TBH, the LIL/DOK matrices should be reimplemented e.g. in Cython, with appropriate low-level data storage. |
Guess this can be closed? |
No, this is a different optimization. |
Rebased and cythonized. |
Changes Unknown when pulling d47e27b on pv:lil-speed into * on scipy:master*. |
@@ -220,11 +220,30 @@ def getrowview(self, i): | |||
def getrow(self, i): | |||
"""Returns a copy of the 'i'th row. | |||
""" | |||
if i < 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is inlined rather than using _check_row_bounds
?
Otherwise, this LGTM |
This needs only a rebase and a very minor tweak it looks like. Time to get it in? |
Rebased in #5789, closing. |
Reopening so that the status of this will be "merged" when I merge #5789. |
The current implementation for slicing LIL matrices is very pessimal. Replace it with a more optimal implementation.
Gives a factor of ~1/density speedup:
Gives speedups also for smaller slices:
(Column slices in LIL are still problematic, but that's due to the matrix format.)
EDIT updated benchmarks