feat: implement Stream
for RowCursor
#283
Open
+125
−106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I only just now saw that #122 was closed as not planned, so no worries if you're not interested in merging this functionality 🙂
Summary
impl<T: RowOwned + RowRead> Stream for RowCursor<T>
UnsafeCell
fromBytesExt
usingpolonius-the-crab
, which the above needed anywayThe
mocked_select
benchmark withvalidation=off
has regressed 20-30% on my machine, butselect_market_data
/select_numbers
/select_nyc_taxi_data
all stayed the same, so I'm not entirely sure how significant this is.It's worth noting that moving the
fn poll_next
logic out ofasync fn next
has subtly changed the behavior ofnext
, because theNext
future doesn't track any state (other than if it has resolved) — every timeRawCursor::poll_next
wakes up the task,RowCursor::poll_next
will first try to deserialize the next row using the available bytes before callingself.raw.poll_next
. I'm not sure if this will matter in practice but if necessary I could move theself.raw.poll_next
call to the start of the loop inRowCursor::poll_next
.Checklist
Delete items not relevant to your PR: