-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
This has probably been discussed before but in case it hasn't: It should be possible to store a vec's capacity as part of its heap allocation and thus shrink Vec
from three to two words. It would make a difference for code that contains many empty Vec
s and code that moves them around a lot. The downside is that the implementation is a bit more complicated and that the capacity can only be accessed after following a pointer. It might still be a worthwhile trade off.
cc @rust-lang/libs (and @nnethercote who likes this kind of thing :)
)
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.