| | 46 | |
| | 47 | Here are the timings for the [attachment:fast-fill-patch-v2.txt new patch] that incorporates Travis' suggestions: |
| | 48 | {{{ |
| | 49 | > python -m timeit -s "from numpy import zeros; x = zeros(10000,'b')" "x.fill(1)" |
| | 50 | 100000 loops, best of 3: 4.61 usec per loop |
| | 51 | > python -m timeit -s "from numpy import zeros; x = zeros(10000,'h')" "x.fill(1)" |
| | 52 | 100000 loops, best of 3: 11.6 usec per loop |
| | 53 | > python -m timeit -s "from numpy import zeros; x = zeros(10000,'i')" "x.fill(1)" |
| | 54 | 100000 loops, best of 3: 11.9 usec per loop |
| | 55 | > python -m timeit -s "from numpy import zeros; x = zeros(10000,'d')" "x.fill(1)" |
| | 56 | 100000 loops, best of 3: 13.1 usec per loop |
| | 57 | }}} |
| | 58 | |
| | 59 | |