zeroshade commented on code in PR #937:
URL: https://github.com/apache/arrow-go/pull/937#discussion_r3580664151
##########
parquet/internal/encoding/streaming/value_buffer.go:
##########
@@ -151,12 +153,23 @@ func (s *streamBuffer) Recycle() {
s.mem.Free(b)
}
s.live = s.live[:0]
- // Rewind the primary chunk; swap out an oversized one so steady state
stays small.
- if len(s.cur) != s.chunkSize {
+ // Compact once the consumed prefix passes half the chunk, so
read-ahead keeps room
+ // without a rotate (peak = one chunk) and the copy stays rare.
Review Comment:
nit: `peak = one chunk` is a little stronger than what the code guarantees.
Compaction only runs once the consumed prefix passes half the chunk, so a small
consumed prefix followed by a larger value can still fall through to `rotate`,
which keeps the old chunk in `live` while allocating the new one — a transient
two-chunk peak. Suggest softening to something like `keeps read-ahead room and
makes rotations rare` rather than implying a hard one-chunk ceiling.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]