I know you are probably busy with the soundness issues right now, so this is going to to be low priority.
I recently ran into an issue where I had wildly varying sizes for different enum members. I could of course box one of them if it is rare, but I had a pretty even distribution in my case. Could we derive a "array of enum variants" similar to this that simply puts all instances of different enum types in different arrays internally, thus reducing memory usage and improving cache locality? I don't know what a good API would look like, some thought is required here.
Yes! I absolutely want to do this, although I plan on doing it as a separate crate. This is a good design I would like to emulate:
https://alic.dev/blog/dense-enums
I know you are probably busy with the soundness issues right now, so this is going to to be low priority.
I recently ran into an issue where I had wildly varying sizes for different enum members. I could of course box one of them if it is rare, but I had a pretty even distribution in my case. Could we derive a "array of enum variants" similar to this that simply puts all instances of different enum types in different arrays internally, thus reducing memory usage and improving cache locality? I don't know what a good API would look like, some thought is required here.