-
Notifications
You must be signed in to change notification settings - Fork 33
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
replace rng with deterministic indexer #104
Conversation
b115cc7
to
932892c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how this simplifies the iteration, and the strategy seems to make sense to me!
Once we fix the offset increment, we should be good to go
Co-authored-by: Consoli <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
/// Generate a range between `0..max`, incrementing the starting point | ||
/// for the next iteration. | ||
pub(crate) fn iter(&mut self) -> IndexIter { | ||
// Increment the starting point for next time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to try to save where we ended up last time and pick up from there?
Closes #85. Additionally it also significantly simplifies our iteration logic by baking it into the
Indexer
struct directly:Performance
The numbers overall seem pretty comparable, but they spiked a bit on non-allocating APIs which are otherwise fairly simple.
impl Race for array
showed one of the bigger changes: