pub enum RowCells<'a> {
Refs(&'a [&'a Value<'static>]),
Values(&'a [Value<'static>]),
}Expand description
One row’s cells, in whichever shape the producer already holds them.
The channel used to be &[&Value] only, which cost a Vec<&Value>
per row at the two producers that build their cells into a
contiguous buffer: they had a &[Value] in hand and collected a
second vector of pointers into it purely to satisfy the type. That
is one heap allocation and one free per row — measured at 400k rows
(round 957) as 9 ns/row, which on a narrow scan was 54-56% of
the whole walk and on a wide one 8-19%.
The reason it could not simply reuse one buffer is that the values buffer is refilled each row, so any pointers into it die at the top of the next iteration; only an owner of the storage (the materialising path, whose rows outlive the loop) can hoist the pointer vector out. Handing the contiguous slice over directly removes the question instead of answering it.
Refs stays for producers whose cells really are scattered (a join
projecting out of several rows).