I recently got my hands on the 1.3 nightly binary and noticed a huge increase in compilation time for my code using static arrays. This goes against what I've noticed for most other code, which generally compiles faster on later versions of julia.
Below is a very simple benchmark with a very long static vector. For more complicated functions, the findings are the same for vectors of more moderate lengths (50-100).
Julia 1.1.0
julia> @time sum(@SVector(zeros(5000)))
10.153586 seconds (20.04 M allocations: 927.505 MiB, 5.88% gc time)
Julia 1.2.0-DEV.647
julia> @time sum(@SVector(zeros(5000)))
17.940720 seconds (30.00 M allocations: 1.436 GiB, 5.17% gc time)
Julia 1.3.0-DEV.249
julia> @time sum(@SVector(zeros(5000)))
47.005255 seconds (30.24 M allocations: 1.445 GiB, 3.44% gc time)
This is slightly worrying as I now frequently think julia has crashed when several minutes are spent on compilation, for codes which previously ran quite fast.
Ref https://discourse.julialang.org/t/compilation-times-for-long-static-vectors-are-increasing/
We're spending all the time here inferring getindex(::SArray, i)
where i
is a constant. That, of course, will never be useful. I think we need some kind of rule to avoid constant propagating getindex
of non-constant AbstractArray types. Trying a simple version of that cuts the time to <= 5 seconds.
Most helpful comment
We're spending all the time here inferring
getindex(::SArray, i)
wherei
is a constant. That, of course, will never be useful. I think we need some kind of rule to avoid constant propagatinggetindex
of non-constant AbstractArray types. Trying a simple version of that cuts the time to <= 5 seconds.