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

Use buffered iterators to speed up the search #3

Open
uselessgoddess opened this issue Jul 30, 2022 · 1 comment
Open

Use buffered iterators to speed up the search #3

uselessgoddess opened this issue Jul 30, 2022 · 1 comment
Labels
Bench:New Bench: create new bench Issue:Easy Issue: a good way to start contributing, mentoring is available Store:Search Store: this is about the search

Comments

@uselessgoddess
Copy link
Member

Currently, op_iter functions use Vec to collect op results to vec and returns vec.into_iter().
I recommend use buffered lock-free iterator generator crate - buter or similar

For example, it will look like this:

//! before
let mut vec = Vec::with_capacity(...);
self.each(..., |link| {
    vec.push(link);
    Continue
});
vec.into_iter()

//! after
let writer = self.buter.writer();
self.each(..., |link| {
    writer.extend(Some(link));
    Continue
});
writer.into_iter()
@uselessgoddess uselessgoddess added the Store:Search Store: this is about the search label Jul 30, 2022
@uselessgoddess
Copy link
Member Author

You also need to create benches to compare with the old implementation.
Check out iter bench

@uselessgoddess uselessgoddess added Issue:Easy Issue: a good way to start contributing, mentoring is available Bench:New Bench: create new bench labels Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bench:New Bench: create new bench Issue:Easy Issue: a good way to start contributing, mentoring is available Store:Search Store: this is about the search
Projects
None yet
Development

No branches or pull requests

1 participant