]> git.ipfire.org Git - thirdparty/zstd.git/commit
introduced parameter ZSTD_p_nonBlockingMode
authorYann Collet <cyan@fb.com>
Wed, 17 Jan 2018 00:15:47 +0000 (16:15 -0800)
committerYann Collet <cyan@fb.com>
Wed, 17 Jan 2018 00:15:47 +0000 (16:15 -0800)
commit1dba98d563d81fb42b4ac575e70eaf52654bbf8e
tree5aa42e2f8a44be226d5b01369b27ca5d42729f2f
parent6025465e42dfce6d3312b14a80e7614bc52b362c
introduced parameter ZSTD_p_nonBlockingMode

This new parameter makes it possible to call
streaming ZSTDMT with a single thread set
which is non blocking.

It makes it possible for the main thread to do other tasks in parallel
while the worker thread does compression.
Typically, for zstd cli, it means it can do I/O stuff.

Applied within fileio.c, this patch provides non-negligible gains during compression.

Tested on my laptop, with enwik9 (1000000000 bytes) : time zstd -f enwik9

With traditional single-thread blocking mode :
real    0m9.557s
user    0m8.861s
sys     0m0.538s

With new single-worker non blocking mode :
real    0m7.938s
user    0m8.049s
sys     0m0.514s

=> 20% faster
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h
lib/compress/zstdmt_compress.c
lib/compress/zstdmt_compress.h
lib/zstd.h
programs/fileio.c