Okay I went in on some of the functions giving me this GC warning and this the output. I don’t see any Any
but line %6 has a yellow color.
function updatexᵢⱼ!(xᵢⱼ, list, points)
#if length(xᵢⱼ) != length(list) resize!(xᵢⱼ, length(list)) end
for (iter, L) in enumerate(list)
i = L[1]; j = L[2];
xᵢⱼ[iter] = points[i] - points[j]
end
end
MethodInstance for SPHExample.SimulationEquations.updatexᵢⱼ!(::Vector{SVector{3, Float64}}, ::Vector{Tuple{Int64, Int64, Float64}}, ::Vector{SVector{3, Float64}})
from updatexᵢⱼ!(xᵢⱼ, list, points) @ SPHExample.SimulationEquations e:\git\SPHExample\src\SimulationEquations.jl:221
Arguments
#self#::Core.Const(SPHExample.SimulationEquations.updatexᵢⱼ!)
xᵢⱼ::Vector{SVector{3, Float64}}
list::Vector{Tuple{Int64, Int64, Float64}}
points::Vector{SVector{3, Float64}}
Locals
@_5::Union{Nothing, Tuple{Tuple{Int64, Tuple{Int64, Int64, Float64}}, Tuple{Int64, Int64}}}
@_6::Int64
L::Tuple{Int64, Int64, Float64}
iter::Int64
j::Int64
i::Int64
Body::Nothing
1 ─ %1 = SPHExample.SimulationEquations.enumerate(list)::Base.Iterators.Enumerate{Vector{Tuple{Int64, Int64, Float64}}}
│ (@_5 = Base.iterate(%1))
│ %3 = (@_5 === nothing)::Bool
│ %4 = Base.not_int(%3)::Bool
└── goto #4 if not %4
2 ┄ %6 = @_5::Tuple{Tuple{Int64, Tuple{Int64, Int64, Float64}}, Tuple{Int64, Int64}}
│ %7 = Core.getfield(%6, 1)::Tuple{Int64, Tuple{Int64, Int64, Float64}}
│ %8 = Base.indexed_iterate(%7, 1)::Core.PartialStruct(Tuple{Int64, Int64}, Any[Int64, Core.Const(2)])
│ (iter = Core.getfield(%8, 1))
│ (@_6 = Core.getfield(%8, 2))
│ %11 = Base.indexed_iterate(%7, 2, @_6::Core.Const(2))::Core.PartialStruct(Tuple{Tuple{Int64, Int64, Float64}, Int64}, Any[Tuple{Int64, Int64, Float64}, Core.Const(3)])
│ (L = Core.getfield(%11, 1))
│ %13 = Core.getfield(%6, 2)::Tuple{Int64, Int64}
│ (i = Base.getindex(L, 1))
│ (j = Base.getindex(L, 2))
│ %16 = Base.getindex(points, i)::SVector{3, Float64}
│ %17 = Base.getindex(points, j)::SVector{3, Float64}
│ %18 = (%16 - %17)::SVector{3, Float64}
│ Base.setindex!(xᵢⱼ, %18, iter)
│ (@_5 = Base.iterate(%1, %13))
│ %21 = (@_5 === nothing)::Bool
│ %22 = Base.not_int(%21)::Bool
└── goto #4 if not %22
3 ─ goto #2
4 ┄ return nothing
Thanks for the explanation of the colors. I care a lot about this since this is performance critical code and I am just uncertain how such a simple function cannot call the garbage collector correctly… I am probably doing something not so clever somewhere.
Kind regards