]> git.ipfire.org Git - thirdparty/zstd.git/commit
Reduce streaming decompression memory by 128KB
authorNick Terrell <terrelln@fb.com>
Fri, 14 Apr 2023 21:27:06 +0000 (14:27 -0700)
committerNick Terrell <nickrterrell@gmail.com>
Mon, 17 Apr 2023 23:31:02 +0000 (16:31 -0700)
commit0abf2baef925fed4dac13d551c35d817e3206fdd
tree94936772f9bf30cbf1f8fd17d75e531f5922eeab
parent7afe0b3bea62a8e1ffdbcbf73028472d97660d8f
Reduce streaming decompression memory by 128KB

The split literals buffer patch increased streaming decompression memory
by 64KB (shrunk lit buffer from 128KB to 64KB, and added 128KB). This
patch removes the added 128KB buffer, because it isn't necessary.

The buffer was there because the literals compression code didn't know
the true `blockSizeMax` of the frame, and always put split literals so
they ended 128KB - 32 from the beginning of the block. Instead, we can
pass down the true `blockSizeMax` and ensure that the split literals
end up at `blockSizeMax - 32` from the beginning of the block. We
already reserve a full `blockSizeMax` bytes in streaming mode, so we
won't be overwriting the extDict window.
lib/decompress/zstd_decompress.c
lib/decompress/zstd_decompress_block.c
lib/decompress/zstd_decompress_block.h
lib/decompress/zstd_decompress_internal.h
tests/fullbench.c