From 447212d07c1981c49f8c1724e1a46d40e6d1039e Mon Sep 17 00:00:00 2001 From: inikep Date: Wed, 28 Sep 2016 12:23:07 +0200 Subject: [PATCH 1/5] RES files for zstd 1.1.0 --- build/VS2010/zstd/generate_res/zstd32.res | Bin 948 -> 948 bytes build/VS2010/zstd/generate_res/zstd64.res | Bin 948 -> 948 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/build/VS2010/zstd/generate_res/zstd32.res b/build/VS2010/zstd/generate_res/zstd32.res index 362d9c22df2cd8fcfd98134449f1eff466c293e6..75705d06802ba59bc017e31c22f8c6169ec8a645 100644 GIT binary patch delta 47 qcmdnOzJ-0l5q?GnMg|ao(i<-uGO`*n=rI^<=47&mGAH{orvm`UcnAal delta 47 ocmdnOzJ-0l5q<^+Mg}Cj@v Date: Wed, 28 Sep 2016 13:23:11 +0200 Subject: [PATCH 2/5] updated .gitignore --- .gitignore | 2 +- zlibWrapper/.gitignore | 26 +++++--------------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 751b674e8..c939f1228 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ zstd # Test artefacts tmp* -dictionary +dictionary* # Other files .directory diff --git a/zlibWrapper/.gitignore b/zlibWrapper/.gitignore index f197c8cc6..1fd8f416c 100644 --- a/zlibWrapper/.gitignore +++ b/zlibWrapper/.gitignore @@ -1,26 +1,10 @@ -# Object files -*.o -*.ko - -# Libraries -*.lib -*.a - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app - # Default result files _* -example -example_zstd +example.* +example_zstd.* +fitblk.* +fitblk_zstd.* +zwrapbench.* foo.gz # Misc files From ba49de38cfadb874b62e8106c77752ddb02f07af Mon Sep 17 00:00:00 2001 From: inikep Date: Mon, 3 Oct 2016 14:19:30 +0200 Subject: [PATCH 3/5] zlibWrapper: updated README.md --- zlibWrapper/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zlibWrapper/README.md b/zlibWrapper/README.md index 427cdbe09..5fefac1d3 100644 --- a/zlibWrapper/README.md +++ b/zlibWrapper/README.md @@ -71,7 +71,7 @@ The script used for compilation can be found at [zlibWrapper/Makefile](Makefile) The zstd distribution contains a tool called `zwrapbench` which can measure speed and ratio of zlib, zstd, and the wrapper. The benchmark is conducted using given filenames or synthetic data if filenames are not provided. -The files are read into memory and joined together. +The files are read into memory and processed independently. It makes benchmark more precise as it eliminates I/O overhead. Many filenames can be supplied as multiple parameters, parameters with wildcards or names of directories can be used as parameters with the -r option. One can select compression levels starting from `-b` and ending with `-e`. The `-i` parameter selects minimal time used for each of tested levels. @@ -119,7 +119,7 @@ In our example (the last 2 lines) it gives 4% better compression speed and 5% be #### Compatibility issues -After enabling zstd compression not all native zlib functions are supported. When calling unsupported methods they put error message into strm->msg and return Z_STREAM_ERROR. +After enabling zstd compression not all native zlib functions are supported. When calling unsupported methods they put error message into `strm->msg` and return Z_STREAM_ERROR. Supported methods: - deflateInit From 23cec875cda890ec965bee15de4797a59550d973 Mon Sep 17 00:00:00 2001 From: inikep Date: Wed, 5 Oct 2016 11:56:22 +0200 Subject: [PATCH 4/5] fixed Makefile targets: zstd-small, zstd-decompress, zstd-compress --- .travis.yml | 2 +- programs/Makefile | 27 ++++++++++++++++----------- programs/zstdcli.c | 5 ++++- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff6ab0f79..5e499ab9f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ matrix: - qemu-user-static - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" CMD="make -C tests versionsTest" + env: PLATFORM="Ubuntu 12.04" CMD="make -C programs zstd-small && make -C programs zstd-decompress && make -C programs zstd-compress && make -C tests versionsTest" - os: linux sudo: required env: PLATFORM="Ubuntu 12.04" CMD="make asan32" diff --git a/programs/Makefile b/programs/Makefile index 6e78d0ea9..ed26f0700 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -70,7 +70,7 @@ VOID = /dev/null endif -.PHONY: default all clean install uninstall +.PHONY: default all clean clean_decomp_o install uninstall default: zstd @@ -92,7 +92,7 @@ zstd32 : $(ZSTDDECOMP32_O) $(ZSTD_FILES) $(ZSTDLEGACY_FILES) $(ZDICT_FILES) \ $(CC) -m32 $(FLAGS) -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT) $^ $(RES32_FILE) -o $@$(EXT) -zstd_nolegacy : +zstd_nolegacy : clean_decomp_o $(MAKE) zstd ZSTD_LEGACY_SUPPORT=0 zstd-pgo : MOREFLAGS = -fprofile-generate @@ -108,18 +108,19 @@ zstd-pgo : clean zstd $(MAKE) zstd MOREFLAGS=-fprofile-use zstd-frugal: $(ZSTDDECOMP_O) $(ZSTD_FILES) zstdcli.c fileio.c - $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_LEGACY_SUPPORT=0 $^ -o zstd$(EXT) + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT $^ -o zstd$(EXT) -zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) \ - zstdcli.c fileio.c - $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) +zstd-small: clean_decomp_o + ZSTD_LEGACY_SUPPORT=0 CFLAGS="-Os -s" $(MAKE) zstd-frugal -zstd-decompress: $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) \ - zstdcli.c fileio.c - $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) +zstd-decompress-clean: $(ZSTDDECOMP_O) $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) zstdcli.c fileio.c + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS $^ -o zstd-decompress$(EXT) -zstd-small: clean - CFLAGS="-Os -s" $(MAKE) zstd-frugal +zstd-decompress: clean_decomp_o + ZSTD_LEGACY_SUPPORT=0 $(MAKE) zstd-decompress-clean + +zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) zstdcli.c fileio.c + $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS $^ -o $@$(EXT) clean: @@ -130,6 +131,10 @@ clean: *.gcda default.profraw @echo Cleaning completed +clean_decomp_o: + @$(RM) $(ZSTDDECOMP_O) + @$(RM) $(ZSTDDECOMP32_O) + #---------------------------------------------------------------------------------- #make install is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 6d1d9f649..fe97f965c 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -231,7 +231,8 @@ int main(int argCount, const char* argv[]) /* init */ (void)recursive; (void)cLevelLast; /* not used when ZSTD_NOBENCH set */ (void)dictCLevel; (void)dictSelect; (void)dictID; /* not used when ZSTD_NODICT set */ - (void)decode; (void)cLevel; /* not used when ZSTD_NOCOMPRESS set */ + (void)decode; (void)cLevel; (void)testmode;/* not used when ZSTD_NOCOMPRESS set */ + (void)ultra; /* not used when ZSTD_NODECOMPRESS set */ if (filenameTable==NULL) { DISPLAY("zstd: %s \n", strerror(errno)); exit(1); } filenameTable[0] = stdinmark; displayOut = stderr; @@ -490,12 +491,14 @@ int main(int argCount, const char* argv[]) CLEAN_RETURN(filenameIdx); } +#ifndef ZSTD_NOCOMPRESS /* check compression level limits */ { int const maxCLevel = ultra ? ZSTD_maxCLevel() : ZSTDCLI_CLEVEL_MAX; if (cLevel > maxCLevel) { DISPLAYLEVEL(2, "Warning : compression level higher than max, reduced to %i \n", maxCLevel); cLevel = maxCLevel; } } +#endif /* No warning message in pipe mode (stdin + stdout) or multi-files mode */ if (!strcmp(filenameTable[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (displayLevel==2)) displayLevel=1; From 0fa190b5ebe424d9c1177ed06f2e49624d914837 Mon Sep 17 00:00:00 2001 From: inikep Date: Wed, 5 Oct 2016 13:41:37 +0200 Subject: [PATCH 5/5] .travis.yml: added "make clean" before versionsTest --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5e499ab9f..972c1b4ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ matrix: - qemu-user-static - os: linux sudo: required - env: PLATFORM="Ubuntu 12.04" CMD="make -C programs zstd-small && make -C programs zstd-decompress && make -C programs zstd-compress && make -C tests versionsTest" + env: PLATFORM="Ubuntu 12.04" CMD="make -C programs zstd-small && make -C programs zstd-decompress && make -C programs zstd-compress && make clean && make -C tests versionsTest" - os: linux sudo: required env: PLATFORM="Ubuntu 12.04" CMD="make asan32"