just a quick question because I do not have this point very clear. That is related to the performance of type-stable against type-unstable fields in structs. For instance consider
mutable struct croco x :: Int64 y :: Float64 croco() = new() end mutable struct krok x y krok() = new() end
and I want to use both structs to store one Int64 and one Float64. To my eyes, croco seems to be the most specific one which should perform best, but somehow I seem too remember to have read somewhere that this is not necessarily the case, as the when I initialize an instance of krok it will be specialized to the types employed, such that
c1 = croco() c1.x = 1 c1.y = 3.1416
k1 = krok() k1.x = 1 k1.y = 3.1416
should perform the same in terms of memory, speed in data access, etc.
Does that make sense or not? Probably not as I tend to bypass many of the fine details of the language… and that’s why I ask in the first place
Thanks for your help,