is inline class overhead the same if it is just an inline class with 0 methods and accessors, or if it has 1+ method, accessor, or implements interface?
d
Dominaezzz
01/28/2020, 8:01 AM
No overhead until you throw in an interface. Even if, there shouldn't be any overhead if you call the interface method directly on the inline class.
j
jimn
01/28/2020, 8:03 AM
virtualization is not an overhead, but are you saying the box size does change with an interface but not with just 0 or more accessors?
d
Dominaezzz
01/28/2020, 8:04 AM
Oh? By overhead I was referring to boxing in itself.
j
jimn
01/28/2020, 8:06 AM
i have a pair of ints. i should probably benchmark tight loops.. if the as a pair, if as an array, if as an Intarray, and inline classes of either. it normally should not come down to perofmrance or locality except when you have 1 or two ints the performance cost of memory is quite a bit higher than other objects