Closed marino39 closed 1 year ago
@poonai I don't want to code in any particular way of deciding if you want to retain data buffer or not. User can code whatever metric he wants to decide.
Batch.Len() returns size of the buffer
Batch.Reset() if you want to reset and clear buffer or Batch.ResetRetained() if you want to reset and keep the buffer
It helps to reduce pressure on the GC by reusing data buffer within batch.
This resets
b.data
whenever it's size is bigger than 1MB. I would like to have my own policy for freeing this data. https://github.com/cockroachdb/pebble/blob/master/batch.go#L1095