Skip to content

Commit 14feaa0

Browse files
committed
Fix slowness of maximum & minimum along dimensions
maximum and minimum along dimensions call ``reducedim`` using ``scalarmax`` and ``scalarmin``. That these two statements did not change following the latest update causes at least 10x slow-down for ``maximum(x, d)`` and ``minimum(x, d)``.
1 parent 1b79ed1 commit 14feaa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/array.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,8 +1465,8 @@ function reducedim(f::Function, A, region, v0, R)
14651465

14661466
if (is(f,+) && (fname=:+;true)) ||
14671467
(is(f,*) && (fname=:*;true)) ||
1468-
(is(f,max) && (fname=:max;true)) ||
1469-
(is(f,min) && (fname=:min;true)) ||
1468+
(is(f,scalarmax) && (fname=:scalarmax;true)) ||
1469+
(is(f,scalarmin) && (fname=:scalarmin;true)) ||
14701470
(is(f,&) && (fname=:&;true)) ||
14711471
(is(f,|) && (fname=:|;true))
14721472
key = (fname, ndimsA)

0 commit comments

Comments
 (0)