Open erickt opened 7 years ago
The only downside would be allocation overhead. However, for these particular messages, they are used infrequently enough that boxing should allow a net win overall. In the future, they may be restructured enough to not require boxing, but I see no problem with it right now.
I'm not sure if this is a big deal or not, but clippy is reporting that a number of variants have large size differences, which can result in lots of wasted space, or excessive memcpys.
Are there any downsides on introducing boxes in these structures? This ended up being a big win for the compiler's AST.