Bizarre times for scipy.sparse.rand
function with 'low' density values.
#9036
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
scipy.sparse
Milestone
The
scipy.sparse.rand
function is strangely slow for some densities. It seems like it can be made much faster without much effort. Thesparse_random
function below seems to be about 10x faster on the worst case of thescipy.sparse.rand
function. The timing plots are equally bizarre, showing terrible performance up until arounddensity=0.4
and then pretty much equivalent timings between both functions.Judging by the code (https://github.com/scipy/scipy/blob/v1.1.0/scipy/sparse/construct.py#L775), it looks to be caused by this conditional
I'm not sure why this is even there and it is not simply
Reproducing code example:
My timings are below:
Scipy/Numpy/Python version information:
The text was updated successfully, but these errors were encountered: