Immutable `Box<Vec<T>>`/`Arc<Vec<T>>` are better stored as `Box<[T]>`/`Arc<[T]>` because: - allocation always exact (no need for `shrink_to_fit`) - smaller (the fat pointer is just the memory address and the length, no capacity required) - less allocation (`Box`/`Arc` -> slice instead of `Box`/`Arc` -> `Vec` -> buffer); in fact the vector itself was offen missing in the accounting code Found while I was working on #7987. Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |