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

NumPy Trac numpy-tickets@scipy....
Thu Aug 18 10:02:27 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 tkluck):

 Here's my very simple comparison of pre-calculating the slopes and not
 doing so. I attached a program in C {{{numpy_interp_bench.c}}} that
 compares the calculation with and without precalculation. The results are:

 {{{
 tkluck@notebook-tjk:~$ time ./numpy_interp_bench 100000000 10 slopes
 interpolating a function with 10 control points at 100000000 points, with
 slope cache

 real    0m11.277s
 user    0m9.940s
 sys     0m1.150s
 tkluck@notebook-tjk:~$ time ./numpy_interp_bench 100000000 10 noslopes
 interpolating a function with 10 control points at 100000000 points,
 without slope cache

 real    0m12.292s
 user    0m11.020s
 sys     0m1.140s
 }}}

 This was what I meant by my statement that in the case that len(x) >
 len(xp), it makes a ~ 10% difference to pre-calculate the slopes.

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


More information about the NumPy-Tickets mailing list