It runs almost instantaneously (< 0.1 seconds) for me, even in global scope:
julia> Output = Array{Union{Missing,Float32}}(rand(Float32, 291,313,31));
julia> @time Pmin, Pmax = extrema(x for x ∈ skipmissing(Output) if !isnan(x))
0.053098 seconds (45.14 k allocations: 3.076 MiB, 57.64% compilation time)
(5.9604645f-8, 0.99999994f0)
Can you give a minimal working example (MWE) of code that reproduces your problem? See also Please read: make it easier to help you
PS. I’ve moved this to a new thread, since it is unrelated to the problem in the original thread. Please don’t “necropost” to ancient threads.