Skip to content
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

Optimize vec::MoveIterator for POD types #10976

Closed
erickt opened this issue Dec 15, 2013 · 1 comment · Fixed by #10995
Closed

Optimize vec::MoveIterator for POD types #10976

erickt opened this issue Dec 15, 2013 · 1 comment · Fixed by #10995

Comments

@erickt
Copy link
Contributor

erickt commented Dec 15, 2013

vec::MoveIterator is written in such a way to be safe for dtors, but this is unnecessary overhead for POD types. Because vec is such an important type, it's worth optimizing for this case. I think all we need is to make use of std::libstd::needs_drop(), but I'm not completely sure if that's all that is needed.

@erickt
Copy link
Contributor Author

erickt commented Dec 15, 2013

I have an experimental implementation of this in this gist. It's roughly twice as fast, but I'm not sure if it's safe yet. It's still 10% slower than v.iter().map(|x| *x) though.

bors added a commit that referenced this issue Dec 16, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
Make [`missing_panics_doc`]  not lint for `todo!()`

closes rust-lang#10966

changelog: [`missing_panics_doc`] now does not lint for `todo!()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant