4 ms·
sum types are awful for data modeling once you put them in an array. So much wasted padding around the tag bit, and wasted space to allow storing the largest va
by assbuttbuttass 3y ago
sum types are awful for data modeling once you put them in an array. So much wasted padding around the tag bit, and wasted space to allow storing the largest variant
- saghm 3y agoSo therefore they shouldn't exist at all? I don't understand this logic
- mhh__ 3y agoHow else would you do it?
- assbuttbuttass 3y agoA common technique is to use a "struct of arrays" approach, rather than an "array of structs" This can save a lot on padding, and greatly increase the cache efficiency
- mhh__ 3y agoUnless you have a tag column that's not the same thing