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

Add find_first and find_last tests on a giant range #362

Merged
merged 3 commits into from
Jun 14, 2017

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jun 12, 2017

It's possible to generate giant iterators in Rayon, and these tests show
that they can still be short-circuited properly in find operations.

// short-circuiting. We probably don't want testing to wait that long. ;)
// It would be nice if `find_last` could prioritize the later splits,
// basically flipping the `join` args, without needing indexed `rev`.
// (or could we have an unindexed `rev`?)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To some extent, this PR is really an RFC about this comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About which part exactly? :)

Like, is there a way to make find_last prioritize the later splits?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I'd like this sort of thing to be usable even in a single-threaded "pool", and walking from start to end is a poor way to find the last match. I doubt it would come up often with absurd iterators like this, but it should be a good optimization to search roughly backwards in general.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. That makes sense. I don't off hand know how best to do that though. =)

It's possible to generate giant iterators in Rayon, and these tests show
that they can still be short-circuited properly in find operations.
@nikomatsakis nikomatsakis merged commit 1f7b60b into rayon-rs:master Jun 14, 2017
@cuviper cuviper deleted the find-octillion branch September 23, 2017 04:56
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 this pull request may close these issues.

None yet

2 participants