-
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
Send VecDeque::from_iter
via Vec::from_iter
#105046
Conversation
Since it's O(1) to convert between them now, might as well reuse the logic. Mostly for the various specializations it does, but might also save some monomorphization work if, say, people collect slice iterators into both `Vec`s and `VecDeque`s.
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit a964a37 with merge f7ad2ffb3732d494ee97cfd8458a0ab47bc56d4c... |
That should be better than using |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
@the8472 Would you want to see that as part of this PR, or would it be fine to do this as-is and add the further specializations later? (I do like the observation that |
I was just airing some thoughts, can totally be a separate PR. |
Finished benchmarking commit (f7ad2ffb3732d494ee97cfd8458a0ab47bc56d4c): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
perf regressions look spurious to me (mostly in noisy benchmarks). @bors r+ |
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
Finished benchmarking commit (203c876): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
…8472 Make `VecDeque::from_iter` O(1) from `vec(_deque)::IntoIter` As suggested in rust-lang#105046 (comment) by r? `@the8472` `Vec` & `VecDeque`'s `IntoIter`s own the allocations, and even if advanced can be turned into `VecDeque`s in O(1). This is just a specialization, not an API or doc commitment, so I don't think it needs an FCP.
…8472 Make `VecDeque::from_iter` O(1) from `vec(_deque)::IntoIter` As suggested in rust-lang#105046 (comment) by r? ``@the8472`` `Vec` & `VecDeque`'s `IntoIter`s own the allocations, and even if advanced can be turned into `VecDeque`s in O(1). This is just a specialization, not an API or doc commitment, so I don't think it needs an FCP.
…ulacrum Send `VecDeque::from_iter` via `Vec::from_iter` Since it's O(1) to convert between them now, might as well reuse the logic. Mostly for the various specializations it does, but might also save some monomorphization work if, say, people collect slice iterators into both `Vec`s and `VecDeque`s.
Make `VecDeque::from_iter` O(1) from `vec(_deque)::IntoIter` As suggested in rust-lang/rust#105046 (comment) by r? ``@the8472`` `Vec` & `VecDeque`'s `IntoIter`s own the allocations, and even if advanced can be turned into `VecDeque`s in O(1). This is just a specialization, not an API or doc commitment, so I don't think it needs an FCP.
Since it's O(1) to convert between them now, might as well reuse the logic.
Mostly for the various specializations it does, but might also save some monomorphization work if, say, people collect slice iterators into both
Vec
s andVecDeque
s.