Julia: Compilation times of long static vectors are increasing

Created on 19 May 2019  路  1Comment  路  Source: JuliaLang/julia

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/

inference latency

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TotalVerb picture TotalVerb  路  3Comments

i-apellaniz picture i-apellaniz  路  3Comments

tkoolen picture tkoolen  路  3Comments

arshpreetsingh picture arshpreetsingh  路  3Comments

musm picture musm  路  3Comments