Merge pull request #401 from inikep/dev

Dev
This commit is contained in:
Yann Collet 2016-10-05 17:56:47 +02:00 committed by GitHub
commit f405b8acbe
8 changed files with 29 additions and 37 deletions

2
.gitignore vendored
View File

@ -21,7 +21,7 @@ zstd
# Test artefacts # Test artefacts
tmp* tmp*
dictionary dictionary*
# Other files # Other files
.directory .directory

View File

@ -44,7 +44,7 @@ matrix:
- qemu-user-static - qemu-user-static
- os: linux - os: linux
sudo: required 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 clean && make -C tests versionsTest"
- os: linux - os: linux
sudo: required sudo: required
env: PLATFORM="Ubuntu 12.04" CMD="make asan32" env: PLATFORM="Ubuntu 12.04" CMD="make asan32"

View File

@ -70,7 +70,7 @@ VOID = /dev/null
endif endif
.PHONY: default all clean install uninstall .PHONY: default all clean clean_decomp_o install uninstall
default: zstd 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) $(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 $(MAKE) zstd ZSTD_LEGACY_SUPPORT=0
zstd-pgo : MOREFLAGS = -fprofile-generate zstd-pgo : MOREFLAGS = -fprofile-generate
@ -108,18 +108,19 @@ zstd-pgo : clean zstd
$(MAKE) zstd MOREFLAGS=-fprofile-use $(MAKE) zstd MOREFLAGS=-fprofile-use
zstd-frugal: $(ZSTDDECOMP_O) $(ZSTD_FILES) zstdcli.c fileio.c 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) \ zstd-small: clean_decomp_o
zstdcli.c fileio.c ZSTD_LEGACY_SUPPORT=0 CFLAGS="-Os -s" $(MAKE) zstd-frugal
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT)
zstd-decompress: $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) \ zstd-decompress-clean: $(ZSTDDECOMP_O) $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) zstdcli.c fileio.c
zstdcli.c fileio.c $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS $^ -o zstd-decompress$(EXT)
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOCOMPRESS -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT)
zstd-small: clean zstd-decompress: clean_decomp_o
CFLAGS="-Os -s" $(MAKE) zstd-frugal 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: clean:
@ -130,6 +131,10 @@ clean:
*.gcda default.profraw *.gcda default.profraw
@echo Cleaning completed @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 #make install is validated only for Linux, OSX, kFreeBSD, Hurd and some BSD targets

View File

@ -231,7 +231,8 @@ int main(int argCount, const char* argv[])
/* init */ /* init */
(void)recursive; (void)cLevelLast; /* not used when ZSTD_NOBENCH set */ (void)recursive; (void)cLevelLast; /* not used when ZSTD_NOBENCH set */
(void)dictCLevel; (void)dictSelect; (void)dictID; /* not used when ZSTD_NODICT 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); } if (filenameTable==NULL) { DISPLAY("zstd: %s \n", strerror(errno)); exit(1); }
filenameTable[0] = stdinmark; filenameTable[0] = stdinmark;
displayOut = stderr; displayOut = stderr;
@ -490,12 +491,14 @@ int main(int argCount, const char* argv[])
CLEAN_RETURN(filenameIdx); CLEAN_RETURN(filenameIdx);
} }
#ifndef ZSTD_NOCOMPRESS
/* check compression level limits */ /* check compression level limits */
{ int const maxCLevel = ultra ? ZSTD_maxCLevel() : ZSTDCLI_CLEVEL_MAX; { int const maxCLevel = ultra ? ZSTD_maxCLevel() : ZSTDCLI_CLEVEL_MAX;
if (cLevel > maxCLevel) { if (cLevel > maxCLevel) {
DISPLAYLEVEL(2, "Warning : compression level higher than max, reduced to %i \n", maxCLevel); DISPLAYLEVEL(2, "Warning : compression level higher than max, reduced to %i \n", maxCLevel);
cLevel = maxCLevel; cLevel = maxCLevel;
} } } }
#endif
/* No warning message in pipe mode (stdin + stdout) or multi-files mode */ /* 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; if (!strcmp(filenameTable[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (displayLevel==2)) displayLevel=1;

View File

@ -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 # Default result files
_* _*
example example.*
example_zstd example_zstd.*
fitblk.*
fitblk_zstd.*
zwrapbench.*
foo.gz foo.gz
# Misc files # Misc files

View File

@ -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 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 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. 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. 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. 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 #### 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: Supported methods:
- deflateInit - deflateInit