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

Refactor `TinyList::contains` and `len` to iterate instead of recurse #62744

Open
wants to merge 2 commits into
base: master
from

Conversation

@llogiq
Copy link
Contributor

commented Jul 17, 2019

No description provided.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Jul 17, 2019

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@Alexendoo

This comment has been minimized.

Copy link
Member

commented Jul 24, 2019

Ping from triage, any updates? @eddyb

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

☔️ The latest upstream changes (presumably #63207) made this pull request unmergeable. Please resolve the merge conflicts.

@llogiq llogiq force-pushed the llogiq:tiny-list-refactor branch from 6704bab to 599cf2e Aug 5, 2019

@llogiq

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2019

Rebased.

@eddyb

eddyb approved these changes Aug 9, 2019

Copy link
Member

left a comment

r=me with benches fixed

@llogiq llogiq force-pushed the llogiq:tiny-list-refactor branch from 599cf2e to 8661a9c Aug 12, 2019

list.insert(1);
})
}

#[bench]
fn bench_insert_one(b: &mut Bencher) {
b.iter(|| {
let mut list = TinyList::new_single(0);
let mut list = black_box(TinyList::new_single(0));
list.insert(1);

This comment has been minimized.

Copy link
@eddyb

eddyb Aug 13, 2019

Member

Oh you also need to produce list from this block, so the insert is not optimized out.

@@ -98,36 +98,57 @@ fn test_remove_single() {
#[bench]
fn bench_insert_empty(b: &mut Bencher) {
b.iter(|| {
let mut list = TinyList::new();
let mut list = black_box(TinyList::new());
list.insert(1);

This comment has been minimized.

Copy link
@eddyb

eddyb Aug 13, 2019

Member

Same here.

@llogiq llogiq force-pushed the llogiq:tiny-list-refactor branch from 8661a9c to 45f14a8 Aug 13, 2019

@llogiq

This comment has been minimized.

Copy link
Contributor Author

commented Aug 16, 2019

@eddyb r?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.