./fitblk_zstd 10240 <../zstd_compression_format.md
./fitblk_zstd 40960 <../zstd_compression_format.md
./zwrapbench -qb3B1K ../zstd_compression_format.md
- ./zwrapbench -qb1e5r ../lib ../programs ../tests
+ ./zwrapbench -rqb1e5 ../lib ../programs ../tests
#valgrindTest: ZSTDLIBRARY = $(ZSTDLIBDIR)/libzstd.so
valgrindTest: VALGRIND = LD_LIBRARY_PATH=$(ZSTDLIBDIR) valgrind --track-origins=yes --leak-check=full --error-exitcode=1
$(VALGRIND) ./fitblk_zstd 10240 <../zstd_compression_format.md
$(VALGRIND) ./fitblk_zstd 40960 <../zstd_compression_format.md
$(VALGRIND) ./zwrapbench -qb3B1K ../zstd_compression_format.md
- $(VALGRIND) ./zwrapbench -qb1e5 ../lib ../programs ../tests
+ $(VALGRIND) ./zwrapbench -rqb1e5 ../lib ../programs ../tests
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
- free the context with `deflateEnd`
To check the difference we made experiments using `zwrapbench -ri6b6` with zstd and zlib compression (both at level 6).
-The input data was decompressed git repository downloaded from https://github.com/git/git/archive/master.zip that contains 2979 files.
+The input data was decompressed git repository downloaded from https://github.com/git/git/archive/master.zip which contains 2979 files.
The table below shows that reusing contexts has a minor influence on zlib but it gives improvement for zstd.
In our example (the last 2 lines) it gives 4% better compression speed and 5% better decompression speed.
if (zwc->zbc == NULL) {
int res;
zwc->zbc = ZSTD_createCStream_advanced(zwc->customMem);
- if (zwc->zbc == NULL) return ZWRAPC_finishWithError(zwc, strm, res);
+ if (zwc->zbc == NULL) return ZWRAPC_finishWithError(zwc, strm, 0);
res = ZWRAP_initializeCStream(zwc, NULL, 0, (flush == Z_FINISH) ? strm->avail_in : 0);
if (res != Z_OK) return ZWRAPC_finishWithError(zwc, strm, res);
} else {