MWE:
mutable struct B
x::Union{Float64, Tuple{Float64, Float64}}
y::Union{Float64, Tuple{Float64, Float64}}
end
ex = B[B(rand(), (rand(),rand())) for _ in 1:10^5];
now if you execute:
julia> Base.summarysize(ex)
7776776
julia> Base.summarysize(ex)
7820648
julia> Base.summarysize(ex)
7923000
julia> Base.summarysize(ex)
7911824
This can become very extreme in some situation, I saw a 2x difference between runs on a more complex vector of structs.
Tested in 1.10 and nightly, same behaviour
MWE:
now if you execute:
This can become very extreme in some situation, I saw a 2x difference between runs on a more complex vector of structs.
Tested in 1.10 and nightly, same behaviour