[Scipy-tickets] [SciPy] #1071: fancy indexation is terrible slow

SciPy Trac scipy-tickets@scipy....
Wed Nov 2 16:28:27 CDT 2011


#1071: fancy indexation is terrible slow
-------------------------------------------------+--------------------------
 Reporter:  dmitrey                              |       Owner:  wnbell      
     Type:  enhancement                          |      Status:  needs_review
 Priority:  normal                               |   Milestone:  Unscheduled 
Component:  scipy.sparse                         |     Version:  0.7.0       
 Keywords:  fancy indexing, performance, sparse  |  
-------------------------------------------------+--------------------------

Comment(by stefan):

 Before patch:

 {{{
 $ python t_lil2.py
 sparsity of the matrix: 0.0243902439024
 time elapsed with lil: 11.552961
 time elapsed with ndarray: 0.445538
 }}}

 After patch:

 {{{
 $ python t_lil2.py
 sparsity of the matrix: 0.0243902439024
 time elapsed with lil: 0.399894
 time elapsed with ndarray: 0.438841
 }}}

 Actually, the patch can be extended to all forms of indexing, except maybe
 scalar.  Which makes me think that the correct way of doing it is to
 generate a warning whenever sequence indexing is done on an lil_matrix,
 telling the user to convert to csc (we can't do that efficiently for
 repeated indexing calls).

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1071#comment:3>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list