Skip to content

Commit

Permalink
Fix slowness of maximum & minimum along dimensions
Browse files Browse the repository at this point in the history
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)``.
  • Loading branch information
lindahua committed Oct 15, 2013
1 parent 1b79ed1 commit 14feaa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1465,8 +1465,8 @@ function reducedim(f::Function, A, region, v0, R)

if (is(f,+) && (fname=:+;true)) ||
(is(f,*) && (fname=:*;true)) ||
(is(f,max) && (fname=:max;true)) ||
(is(f,min) && (fname=:min;true)) ||
(is(f,scalarmax) && (fname=:scalarmax;true)) ||
(is(f,scalarmin) && (fname=:scalarmin;true)) ||
(is(f,&) && (fname=:&;true)) ||
(is(f,|) && (fname=:|;true))
key = (fname, ndimsA)
Expand Down

0 comments on commit 14feaa0

Please sign in to comment.