summaryrefslogtreecommitdiff
path: root/numpy/array_api/_elementwise_functions.py
diff options
context:
space:
mode:
authorAntony Lee <anntzer.lee@gmail.com>2021-08-02 20:37:30 +0200
committerAntony Lee <anntzer.lee@gmail.com>2021-08-03 20:37:57 +0200
commit557bb33ff71c6aae64a85e58d2b78b2c8877a0f5 (patch)
treea913025052d310a8466cc7e66e2462660481073e /numpy/array_api/_elementwise_functions.py
parentf25905b5d25a2fca1e23adad11d4597a1e658276 (diff)
downloadnumpy-557bb33ff71c6aae64a85e58d2b78b2c8877a0f5.tar.gz
PERF: Avoid using `@recursive`.
None of the functions decorated with `@recursive` actually need to close over internal variables, so they can be lifted to become toplevel recursive functions which avoid the need for an `@recursive` decorator. (No change was made to the logic of any of the functions.) As it turns out, the `@recursive` decorator adds a lot of overhead: `python runtests.py --bench bench_io` reports a ~15-20% perf gain(!) for `loadtxt` from this PR. (`_recursive_mask_or` seems less likely to matter performance-wise, but I also lifted it out for good measure... and just deleted the decorator's implementation.)
Diffstat (limited to 'numpy/array_api/_elementwise_functions.py')
0 files changed, 0 insertions, 0 deletions