Message312495
True at least to PY2.7 and 3.5 - given x is a numpy array, say np.random.rand(int(1e6)), then sum(x) is much slower (for 1e6 elements - 2 orders of magnitude) than x.sum().
Now, while this is understandable behaviour, I wander how hard it is to add a condition that if argument is a Numpy object then use its own sum.
I think many programmers aren't aware of that, so all in all it can improve the performance of a lot of existing code. |
|
Date |
User |
Action |
Args |
2018-02-21 14:06:26 | urielias | set | recipients:
+ urielias |
2018-02-21 14:06:26 | urielias | set | messageid: <1519221986.73.0.467229070634.issue32895@psf.upfronthosting.co.za> |
2018-02-21 14:06:26 | urielias | link | issue32895 messages |
2018-02-21 14:06:26 | urielias | create | |
|