Repository navigation
Conversation
📝 WalkthroughWalkthroughThis PR introduces sequence-based ordering to handle out-of-order completions in Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
After discussion with the team, if we were to use this, we would prefer to make it a wrapper, rather than changing the original implementation. |
Disclaimer: I know I know. We want to reduce the number of allocations as much as possible. This PR introduces a bit of overhead by using a hashmap as buffer, but I don't think it is that bad because:
usize, so should be quick, and IO costs a lot more anyway.Returning things out-of-order makes handling the iterator a lot more complex (example), and makes users of UniversalRead iterator having to handle the special case of IoUring for every case.
For iterators, we almost always have to wait until the next sequential item, even if we are capable of processing others in the meantime. So I think there is no big benefit of complicating the callsites everywhere, when we can contain it to the read iterator itself.
This PR ensures items are in order by: