Thomas Dybdahl Ahle added the comment: 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 ---------- Added file: http://bugs.python.org/file35448/select2.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21592> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com