Author thomasahle
Recipients alex, ezio.melotti, jtaylor, scoder, steven.daprano, terry.reedy, thomasahle, tim.peters, vajrasky
Date 2014-06-02.11:54:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401710049.09.0.764111722184.issue21592@psf.upfronthosting.co.za>
In-reply-to
Content
I don't know if it's worth the overhead to implement a multiselect, given we only expose a median function.

I've rewritten select2 to be intro, just falling back on sorting. This doesn't appear to degrade the performance.

I also added np.median to the test-suite. And it is indeed pretty snappy. Though not more than select2 under pypy. There is a discussion here https://github.com/numpy/numpy/issues/1811

== Single call mode ==
N        sort     select7  select23 select47 select97 select   select2  select2b np.median
-------- -------- -------- -------- -------- -------- -------- -------- -------- ---------
    5000    0.002    0.006    0.004    0.004    0.004    0.008    0.003    0.003    0.000
   10000    0.004    0.011    0.008    0.008    0.008    0.014    0.007    0.007    0.001
   50000    0.025    0.057    0.044    0.041    0.043    0.054    0.028    0.028    0.005
  100000    0.055    0.117    0.087    0.085    0.089    0.137    0.079    0.080    0.014
  500000    0.366    0.635    0.474    0.467    0.485    0.534    0.445    0.446    0.105
 1000000    0.802    1.321    1.001    0.985    1.012    1.392    0.936    0.920    0.216
 2000000    1.833    2.666    2.020    1.989    2.040    3.039    1.815    1.821    0.468
 3000000    2.829    4.039    3.034    2.980    3.116    3.191    2.622    2.634    0.704
 4000000    4.013    5.653    4.275    4.284    4.209    6.200    3.715    3.755    0.998
 5000000    5.192    6.888    5.137    5.029    5.201    5.826    5.047    5.084    1.271
History
Date User Action Args
2014-06-02 11:54:09thomasahlesetrecipients: + thomasahle, tim.peters, terry.reedy, scoder, ezio.melotti, steven.daprano, alex, jtaylor, vajrasky
2014-06-02 11:54:09thomasahlesetmessageid: <1401710049.09.0.764111722184.issue21592@psf.upfronthosting.co.za>
2014-06-02 11:54:09thomasahlelinkissue21592 messages
2014-06-02 11:54:07thomasahlecreate