3 ms·
> Especially for step 6, using a Vec as a Box, I would not expect that to save much. It's not that using a Vec as a Box saves anything at all. It's that gener
by pdpi 3y ago
> Especially for step 6, using a Vec as a Box, I would not expect that to save much.
It's not that using a Vec as a Box saves anything at all. It's that generics require monomorphisation, and that eats up a bunch of space, and more instances of generic types translates into more space.
If your application uses Vec<i16> elsewhere, you've already paid the binary size price for using it. Vec<i16> is close enough to Box<[i16]> that the functional differences don't warrant the extra code generation.