[NumPy-Tickets] [NumPy] #1920: Improve numpy.interp running time

NumPy Trac numpy-tickets@scipy....
Tue Aug 16 11:24:20 CDT 2011


#1920: Improve numpy.interp running time
-------------------------------------------------------+--------------------
 Reporter:  tkluck                                     |       Owner:  somebody   
     Type:  enhancement                                |      Status:  new        
 Priority:  normal                                     |   Milestone:  Unscheduled
Component:  numpy.core                                 |     Version:  1.6.0      
 Keywords:  patch; linear interpolation; running time  |  
-------------------------------------------------------+--------------------

Comment(by rgommers):

 I'm not 100% sure I understand the statements on speed.  You have two
 cases:

   1. len(xp) <= len(x)
   2. len(xp) > len(x)

 The new code is almost unchanged for case 1, and is "slightly slower".
 For case 2, caching the slopes is removed, resulting in a 10% speed-up.
 Correct or not? If so, I'm not sure I'd call that a "severe speed
 penalty". Can you provide a snippet used to measure the speed difference?

 Looking at the tests, only case 1 is tested. So your patch would need some
 tests. Also a few more comments in the code about that the if/else is
 there for speed reasons etc. would be helpful.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1920#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list