Skip to content

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

@yegor256

Description

@yegor256

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions