Since this struct is used for everything, This basically means there is a 40% increase in memory, or in other terms basically 40% of the memory used by DD is air.
Now! There is a way to disable this behavior in the compiler. I mentioned this to lummox over pm to ask if he had tried it, he said he hadn't.
#pragma pack(push, 1) // exact fit - no padding
struct value
{
char typeid;
union value {...};
};
#pragma pack(pop) //return to old pack value
This has the chance to bring a 40% reduction in memory usage! but at a cost. I haven't been able to get any actual benchmarks or data out of the theorycrafters on google, but theory is that it would cost more to access the data as they would more likely be out of alignment with the WORD size used to access data.
So, what I am hoping for, is for lummox to push out a version of the 512 beta that has pack 1 enabled, so the peoples can run benchmarks on it to see if the overhead/memory tradeoff is worth it or not.
Because its literally a two line change*, the hope is that this doesn't represent a high time investment to test what might be a bad change.
(And that's not to mention the benchmarks that I saw that suggested packing might increase performance because of the cpu cache)
* the claim "two line change" does not take in to account any backwards compatibility code needed if any savefiles or network data is serialized directly in values without sanitation
We're sort of desperate for memory at the moment in our project, and there's no harm in trying this.