Optimize listpack for stream usage to avoid repeated reallocs (#6281)
Avoid repeated reallocs growing the listpack while entries are being added. This is done by pre-allocating the listpack to near maximum size, and using malloc_size to check if it needs realloc or not. When the listpack reaches the maximum number of entries, we shrink it to fit it's used size. Co-authored-by:Viktor Söderqvist <viktor@zuiderkwast.se> Co-authored-by:
Oran Agra <oran@redislabs.com>
Please register or sign in to comment