diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2015-01-20 19:29:34 +0100 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2015-01-20 19:33:50 +0100 |
commit | bc1b8926d10d5aa85f035d62fcf6d1f007c4a8af (patch) | |
tree | fc5bc6bfb35a28e557cc70579fc407e9d99133f3 /numpy/polynomial/polyutils.py | |
parent | 4ed1587a7de85b4fa01dff8ef6e0e901a25f149c (diff) | |
download | numpy-bc1b8926d10d5aa85f035d62fcf6d1f007c4a8af.tar.gz |
ENH: faster fastclip functions
copying the element in the loop via an else is significantly faster than
copying first and skipping the else clause as it allows the compiler to
use branchless instructions like minsd/maxsd.
For floats this is 3 times faster for min xor max and 40% faster for min
and max. Further improvements are possible via vectorization.
There is a penalty for inplace clips due to higher memory bandwidth
usage but it seems to be less than 10% and could be easily recovered
with another template specialization if required.
Diffstat (limited to 'numpy/polynomial/polyutils.py')
0 files changed, 0 insertions, 0 deletions