There some things that are a little strange in this MWE.
- The vector
Asimply cannot have-Inf,Inf, orNaN. So you are always just testing how a pass that do not replace anything should go. - The
0literal is interpreted asInt(which is an alias for eitherInt32orInt64in your system), so there is probably an automatic conversion (maybe optimized away) to the0.0, otherwisereplace!should not work, as it changes the vector in place and you cannot save aIntin aVector{Float64}without converting. -
randreturns aVector{Float64}such type simply cannot havemissingvalues, another red flag is the number of allocations, there is no reason forreplace!to allocate anything, I believe what is happening here is that something insidereplace!became type-unstable because of the strange types in the pairs, ideally all pairs should have aFloat64in the right and the left side, unless your vector is aVector{Float64,Missing}.