-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make SmallVector
more general-purpose
#37371
Comments
I've started some part of this work in implementing a |
I wonder if there's a way to use the existing rust-smallvec crate yet. |
eddyb
added a commit
to eddyb/rust
that referenced
this issue
Nov 11, 2016
…ddyb Replace syntax's SmallVector with AccumulateVec This adds a new type to data_structures, `SmallVec`, which wraps `AccumulateVec` with support for re-allocating onto the heap (`SmallVec::reserve`). `SmallVec` is then used to replace the implementation of `SmallVector` in libsyntax. r? @eddyb Fixes rust-lang#37371. Using `SmallVec` instead of libsyntax's `SmallVector` will provide the `N = 2/4` case easily (just needs a few more `Array` impls). cc @nnethercote, probably interested in this area
eddyb
added a commit
to eddyb/rust
that referenced
this issue
Nov 12, 2016
…ddyb Replace syntax's SmallVector with AccumulateVec This adds a new type to data_structures, `SmallVec`, which wraps `AccumulateVec` with support for re-allocating onto the heap (`SmallVec::reserve`). `SmallVec` is then used to replace the implementation of `SmallVector` in libsyntax. r? @eddyb Fixes rust-lang#37371. Using `SmallVec` instead of libsyntax's `SmallVector` will provide the `N = 2/4` case easily (just needs a few more `Array` impls). cc @nnethercote, probably interested in this area
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SmallVector
is a very useful type. It can avoid lots of heap allocations when used on hot paths, which can give nice speed-ups. I have used it in multiple places, and I have more changes in the pipeline that will use it.But it's not quite as general-purpose as it could be. Ideas for improvement:
SmallVec
, to mirrorVec
.Vec
. E.g. changezero()
tonew()
.The text was updated successfully, but these errors were encountered: