summaryrefslogtreecommitdiff
path: root/numpy/array_api/_elementwise_functions.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-12-04 14:03:02 -0600
committerSebastian Berg <sebastian@sipsolutions.net>2021-12-07 17:13:23 -0600
commit0353fef12215f4d5bb72389974905eb80f0984a8 (patch)
treec0b0f9812903a78b1be094082c8e935e8290c3c1 /numpy/array_api/_elementwise_functions.py
parent51d99b2a2746ac1ad16c1d2db8da8197e8200367 (diff)
downloadnumpy-0353fef12215f4d5bb72389974905eb80f0984a8.tar.gz
PERF: Fix performance bug in dispatching cache
In promotion cases, the result of the dispatching was not cached (at least not as well as it could be). This lead to large slowdowns in cases where promotion is necessary, one example: a = np.array([3]); b = np.array([3.]) %timeit a + b The fix here is fairly small, and almost a cleanup, since I put the whole `cache=True` logic in the wrong place really. (I currently do not ever cache promoters, to be fair, this could be done but should be unnecessary and may require a bit of thought. Another thing that could be optimized is caching if there is no matching loop to speed up error paths.)
Diffstat (limited to 'numpy/array_api/_elementwise_functions.py')
0 files changed, 0 insertions, 0 deletions