And it’s much worse in 1.10
A type stability issue?
using JET
using Statistics
@report_opt cov(rand(10,3))
═════ 32 possible errors found ═════
┌ cov(X::Matrix{Float64}) @ Statistics C:\workdir\usr\share\julia\stdlib\v1.9\Statistics\src\Statistics.jl:584
│┌ cov(X::Matrix{Float64}; dims::Int64, corrected::Bool) @ Statistics C:\workdir\usr\share\julia\stdlib\v1.9\Statistics\src\Statistics.jl:584
││┌ kwcall(::NamedTuple{(:corrected,), Tuple{Bool}}, ::typeof(Statistics.covm), x::Matrix{Float64}, xmean::Matrix{Float64}, vardim::Int64) @ Statistics C:\workdir\usr\share\julia\stdlib\v1.9\Statistics\src\Statistics.jl:561
│││┌ covm(x::Matrix{Float64}, xmean::Matrix{Float64}, vardim::Int64; corrected::Bool) @ Statistics C:\workdir\usr\share\julia\stdlib\v1.9\Statistics\src\Statistics.jl:561
...
With 1.10b3
@report_opt cov(rand(10,3))
═════ 190 possible errors found ═════
┌ cov(X::Matrix{Float64}) @ Statistics C:\programs\Julia-1.10\share\julia\stdlib\v1.10\Statistics\src\Statistics.jl:594
│┌ cov(X::Matrix{Float64}; dims::Int64, corrected::Bool) @ Statistics C:\programs\Julia-1.10\share\julia\stdlib\v1.10\Statistics\src\Statistics.jl:594
││┌ kwcall(::@NamedTuple{corrected::Bool}, ::typeof(Statistics.covm), x::Matrix{Float64}, xmean::Matrix{Float64}, vardim::Int64) @ Statistics C:\programs\Julia-1.10\share\julia\stdlib\v1.10\Statistics\src\Statistics.jl:571
│││┌ covm(x::Matrix{Float64}, xmean::Matrix{Float64}, vardim::Int64; corrected::Bool) @ Statistics C:\programs\Julia-1.10\share\julia\stdlib\v1.10\Statistics\src\Statistics.jl:571
...
A probable side effect of this is that a precompiled cache that uses it in a function is 4 MB bigger if I include it in the PrecompileTools @setup_workload