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

Stack::into_iter() is slower than Vec::into_iter() #16

Open
yegor256 opened this issue May 15, 2023 · 0 comments
Open

Stack::into_iter() is slower than Vec::into_iter() #16

yegor256 opened this issue May 15, 2023 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@yegor256
Copy link
Owner

According to the results of vs_vec.rs bench, we are slower in iterating than Vec:

$ rustup run nightly cargo bench
...
     Running benches/vs_vec.rs (target/release/deps/vs_vec-903d5e84934e313a)

running 2 tests
test stack_push_and_pop ... bench:       6,058 ns/iter (+/- 449)
test vec_push_and_pop   ... bench:       3,425 ns/iter (+/- 138)

The problem is in the into_iter() method. Let's figure out where is the lag and fix.

@yegor256 yegor256 added bug Something isn't working help wanted Extra attention is needed labels May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant