scipy/scipy — pull request #3356 by pv (2014-02-19 22:20:09+00:00)
Title: ENH: sparse: speed up LIL indexing + assignment via Cython

This PR gains 5...50x speedups in LIL matrix by writing the fancy indexing code more carefully. I also add fast paths for scalar indexing (~5x faster).

The fancy getitem speed is now on par with CSR/CSC. Fancy setitem is on par with CSR/CSC (*when sparsity pattern is unchanged* --- for changing sparsity pattern, LIL can now be much faster than CSR/CSC).

Benchmarks: https://gist.githubusercontent.com/pv/9102868/raw/38d4f94d5347d4fcb1050046374b0001ed525ee6/gistfile1.txt