Skip to content

create JSONArrayBuf with larger initial buffer

Created by: camdencheek

This allocates the initial buffer for a JSONArrayBuf to its flush size. Since we will very frequently have enough results to hit the flush size, this saves a large number of small allocations used to grow the buffer in intermediate steps.

This change was guided by searcher profiles that showed a large number of live byte slices allocated by buffer.Grow(). It should help reduce memory pressure on searcher while streaming large result sets.

Merge request reports

Loading