Hello!
I try to use sprs package in my experimental code. I have encountered the issue of very slow multiplication of large sparse matrices.
My code uses large diagonal matrices in CSR format. The matrices might contain from hundreds/thousands to millions NNZ elements. Multiplication of such matrices in sprs has almost quadratic complexity O(nnz^2). So we cannot use sprs in production code currently.
I wrote some tests in Rust+sprs and Python+scipy. SciPy uses SMMP algorithm (Sparse Matrix Multiplication Package) and perform multiplication such matrices in tens/hundreds of milliseconds.
The code of my benchmarks can be found on gist: https://gist.github.com/espdev/d278962828ce7360d653b8679d7bb511
The plot for mat * mat.T:

Could you consider using SMMP algorithm in sprs? This algorithm has complexity O(n_row*K^2 + max(n_row,n_col)) where K is the maximum nnz in a row of A and column of B.
Hello!
I try to use sprs package in my experimental code. I have encountered the issue of very slow multiplication of large sparse matrices.
My code uses large diagonal matrices in CSR format. The matrices might contain from hundreds/thousands to millions
NNZelements. Multiplication of such matrices in sprs has almost quadratic complexityO(nnz^2). So we cannot use sprs in production code currently.I wrote some tests in Rust+sprs and Python+scipy. SciPy uses SMMP algorithm (Sparse Matrix Multiplication Package) and perform multiplication such matrices in tens/hundreds of milliseconds.
The code of my benchmarks can be found on gist: https://gist.github.com/espdev/d278962828ce7360d653b8679d7bb511
The plot for

mat * mat.T:Could you consider using SMMP algorithm in sprs? This algorithm has complexity
O(n_row*K^2 + max(n_row,n_col))where K is the maximum nnz in a row of A and column of B.