]>
git.ipfire.org Git - thirdparty/zstd.git/log
Yann Collet [Tue, 30 Jan 2018 23:05:12 +0000 (15:05 -0800)]
updated zstd api manual
Yann Collet [Tue, 30 Jan 2018 23:03:39 +0000 (15:03 -0800)]
fixed function declaration ZSTD_getBlockSize()
Yann Collet [Tue, 30 Jan 2018 22:43:36 +0000 (14:43 -0800)]
zstdmt: changed naming convention
to avoid confusion with blocks.
also:
- jobs are cut into chunks of 512KB now, to reduce nb of mutex calls.
- fix function declaration ZSTD_getBlockSizeMax()
- fix outdated comment
Yann Collet [Sat, 27 Jan 2018 02:18:42 +0000 (18:18 -0800)]
fixed minor conversion warning for C++ compilation mode
Yann Collet [Sat, 27 Jan 2018 02:09:25 +0000 (18:09 -0800)]
job mutex creation is checked
Yann Collet [Sat, 27 Jan 2018 01:48:33 +0000 (17:48 -0800)]
zstdmt: there is now one mutex/cond per job
Yann Collet [Sat, 27 Jan 2018 01:08:58 +0000 (17:08 -0800)]
zstdmt: minor code refactor for clarity
Yann Collet [Fri, 26 Jan 2018 22:35:54 +0000 (14:35 -0800)]
zstdmt: job table correctly cleaned after synchronous ZSTDMT_compress()
Yann Collet [Fri, 26 Jan 2018 21:00:14 +0000 (13:00 -0800)]
zstdmt : refactor a few member names
for clarity
Yann Collet [Fri, 26 Jan 2018 20:15:43 +0000 (12:15 -0800)]
zstdmt : flush() only lock to read shared job members
Other job members are accessed directly.
This avoids a full job copy, which would access everything,
including a few members that are supposed to be used by worker only,
uselessly requiring additional locks to avoid race conditions.
Yann Collet [Fri, 26 Jan 2018 19:06:34 +0000 (11:06 -0800)]
minor : ZSTDMT_writeLastEmptyBlock() is a void function
because it cannot fail
Yann Collet [Fri, 26 Jan 2018 18:44:09 +0000 (10:44 -0800)]
zstdmt : fixed memory leak
writeLastEmptyBlock() must release srcBuffer
as mtctx assumes it's done by job worker.
minor : changed 2 job member names (src->srcBuffer, srcStart->prefixStart) for clarity
Yann Collet [Fri, 26 Jan 2018 18:20:38 +0000 (10:20 -0800)]
zstdmt : refactor job members
grouped by sharing properties
Yann Collet [Fri, 26 Jan 2018 01:45:18 +0000 (17:45 -0800)]
fixed minor declaration-after-statement warning
Yann Collet [Fri, 26 Jan 2018 01:35:49 +0000 (17:35 -0800)]
zstdmt: removed job->jobCompleted
replaced by equivalent signal job->consumer == job->srcSize.
created additional functions
ZSTD_writeLastEmptyBlock()
and
ZSTDMT_writeLastEmptyBlock()
required when it's necessary to finish a frame with a last empty job, to create an "end of frame" marker.
It avoids creating a job with srcSize==0.
Yann Collet [Thu, 25 Jan 2018 22:52:34 +0000 (14:52 -0800)]
zstdmt:: renamed mutex and cond to underline they are context-global
Yann Collet [Wed, 24 Jan 2018 02:00:51 +0000 (18:00 -0800)]
zstdmt : fixed complex sequencing bug
zstdmt would shortcut to single-thread blocking mode
in some rare cases where data is sent to be compressed but is not yet ready.
Yann Collet [Tue, 23 Jan 2018 23:52:40 +0000 (15:52 -0800)]
zstdmt : correctly set end of frame
Yann Collet [Tue, 23 Jan 2018 23:19:11 +0000 (15:19 -0800)]
zstdmt : fix end condition (ZSTD_e_end)
When ZSTD_e_end directive is provided,
the question is not only "are internal buffers completely flushed",
it is also "is current frame completed".
In some rare cases,
it was possible for internal buffers to be completely flushed,
triggering a @return == 0,
but frame was not completed as it needed a last null-size block to mark the end,
resulting in an unfinished frame.
Yann Collet [Tue, 23 Jan 2018 22:03:07 +0000 (14:03 -0800)]
zstdmt: fixed minor race condition
no real consequence, but pollute tsan tests :
job->dstBuff is being modified inside worker,
while main thread might read it accidentally
because it copies whole job.
But since it doesn't used dstBuff, there is no real consequence.
Other potential solution : only copy useful data, instead of whole job
Yann Collet [Tue, 23 Jan 2018 21:12:40 +0000 (13:12 -0800)]
zstdmt : fixed ending frame with 0-size block
Yann Collet [Sat, 20 Jan 2018 06:11:11 +0000 (22:11 -0800)]
zstreamtest : fixed test 32 : multi-thread compression
using ZSTD_compress_generic(,,ZSTD_e_end)
Since it already provides ZSTD_e_end as directive,
it should not be followed by ZSTDMT_endStream().
Yann Collet [Sat, 20 Jan 2018 02:19:09 +0000 (18:19 -0800)]
zstdmt : fixed last job size
Yann Collet [Sat, 20 Jan 2018 01:35:08 +0000 (17:35 -0800)]
zstdmt : finally vanquished an elusive and rare race condition
Yann Collet [Fri, 19 Jan 2018 21:19:59 +0000 (13:19 -0800)]
zstdmt : simplify job creation
job will not be created when not enough room within job Table
Yann Collet [Fri, 19 Jan 2018 20:41:56 +0000 (12:41 -0800)]
zstdmt: fixed corruption issue in ZSTDMT_endStream()
when invoked directly.
Yann Collet [Fri, 19 Jan 2018 18:01:40 +0000 (10:01 -0800)]
zstdmt uses POOL_tryAdd() to call a new worker
so that it's no longer a blocking call.
This makes it possible to stream out data gradually,
while waiting for a worker to become available.
Yann Collet [Fri, 19 Jan 2018 00:20:26 +0000 (16:20 -0800)]
fixed frame checksum issue
and race conditions
Yann Collet [Thu, 18 Jan 2018 22:39:51 +0000 (14:39 -0800)]
added POOL_tryAdd()
Yann Collet [Thu, 18 Jan 2018 21:35:24 +0000 (13:35 -0800)]
Merge branch 'progressiveMT' into progressiveFlush
Yann Collet [Thu, 18 Jan 2018 21:34:56 +0000 (13:34 -0800)]
Merge branch 'dev' into progressiveMT
Yann Collet [Thu, 18 Jan 2018 21:34:31 +0000 (13:34 -0800)]
Merge pull request #997 from terrelln/empty-dict
Set repcodes for empty ZSTD_CDict
Nick Terrell [Thu, 18 Jan 2018 21:28:30 +0000 (13:28 -0800)]
Set repcodes for empty ZSTD_CDict
When the dictionary is <= 8 bytes, no data is loaded from the dictionary.
In this case the repcodes weren't set, because they were inserted after the
size check. Fix this problem in general by first setting the cdict state to
a clean state of an empty dictionary, then filling the state from there.
Yann Collet [Thu, 18 Jan 2018 19:27:13 +0000 (11:27 -0800)]
fileio: READY_FOR_UPDATE() is now a function-like macro
as suggested by @terrelln
Yann Collet [Thu, 18 Jan 2018 19:15:23 +0000 (11:15 -0800)]
fixes for @terrelln comments
Yann Collet [Thu, 18 Jan 2018 19:03:27 +0000 (11:03 -0800)]
zstdmt: added ability to flush current job before it's completed
however, zstdmt may still wait on next available worker,
so it's not smooth yet.
Yann Collet [Thu, 18 Jan 2018 01:18:19 +0000 (17:18 -0800)]
fixed a few access contention
passes thread sanitizer test
Yann Collet [Thu, 18 Jan 2018 00:39:02 +0000 (16:39 -0800)]
Introduce ZSTD_getFrameProgression()
Produces 3 statistics for ongoing frame compression :
- ingested
- consumed (effectively compressed)
- produced
Ingested can be larger than consumed due to buffering effect.
For the time being, this patch mostly fixes the % ratio issue,
since it computes consumed / produced,
instead of ingested / produced.
That being said, update is not "smooth",
because on a slow enough setting,
fileio spends most of its time waiting for a worker to complete its job.
This could be improved thanks to more granular flushing
i.e. start flushing before ongoing job is fully completed.
Yann Collet [Wed, 17 Jan 2018 22:35:23 +0000 (14:35 -0800)]
Merge pull request #991 from facebook/progressiveMT
Non-blocking compression
Yann Collet [Wed, 17 Jan 2018 21:52:56 +0000 (13:52 -0800)]
Merge pull request #993 from krab/dev-cmake-windows-mt
CMake: fixed multithreading build on Windows
Yann Collet [Wed, 17 Jan 2018 21:51:03 +0000 (13:51 -0800)]
Merge branch 'dev' into progressiveMT
fixed minor conflict on cdict
Yann Collet [Wed, 17 Jan 2018 21:47:42 +0000 (13:47 -0800)]
Merge pull request #992 from terrelln/small-cdict
Reduce size of ZSTD_CDict
Yann Collet [Wed, 17 Jan 2018 20:39:58 +0000 (12:39 -0800)]
zstdmt : fixed very large window sizes
would create too large buffers,
since default job size == window size * 4.
This would crash on 32-bit systems.
Also : jobSize being a 32-bit unsigned, it cannot be >= 4 GB,
so the formula was failing for large window sizes >= 1 GB.
Fixed now : max job Size is 2 GB, whatever the window size.
Yann Collet [Wed, 17 Jan 2018 20:10:15 +0000 (12:10 -0800)]
zstdmt: fixed an endless loop on allocation failure
this happened on 32-bits build when requiring a too large input buffer,
typically on wlog=29, creating jobs of 2 GB size.
also : zstd32 now compiles with multithread support enabled by default
(can be disabled with HAVE_THREAD=0)
Nick Terrell [Tue, 16 Jan 2018 23:23:39 +0000 (15:23 -0800)]
Reduce size of ZSTD_CDict
Shaves 492,076 B off of the `ZSTD_CDict`.
The size of a `ZSTD_CDict` created from a 112,640 B dictionary is:
| Level | Before (B) | After (B) |
|-------|------------|-----------|
| 1 | 648,448 | 156,412 |
| 3 | 1,140,008 | 647,932 |
Yann Collet [Wed, 17 Jan 2018 19:39:07 +0000 (11:39 -0800)]
zstdmt: minor variable renaming, for clarity
Alexey Ivanov [Wed, 17 Jan 2018 07:27:52 +0000 (10:27 +0300)]
CMake: fixed multithreading build on Windows
`ZSTD_MULTITHREAD_SUPPORT` option fixed for Windows.
Signed-off-by: Alexey Ivanov <alexey.ivanes@gmail.com>
Yann Collet [Wed, 17 Jan 2018 01:35:00 +0000 (17:35 -0800)]
fix fileio progression status update
The compression % is no longer correct,
since it's no longer possible to make direct correlation
between nb bytes read and nb bytes written
due to large internal buffer inside CCtx
(exacerbated with --long).
The current "fix" is to no longer display the %.
A more complex solution will have to count exactly how much data has been consumed and compressed internally, within CCtx buffers.
Yann Collet [Wed, 17 Jan 2018 01:28:11 +0000 (17:28 -0800)]
cli: fix for no-MT mode
when cli is compiled without MT support,
invoking ZSTD_p_nonBlockingMode result in an error code.
This patch only sets ZSTD_p_nonBlockingMode when ZSTD_MULTITHREAD is set, meaning there is MT support.
The error code could also be intentionnally ignored (there is no side effect).
Yann Collet [Wed, 17 Jan 2018 00:15:47 +0000 (16:15 -0800)]
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
Yann Collet [Tue, 16 Jan 2018 23:34:41 +0000 (15:34 -0800)]
ZSTDMT : minor CCtx memory optimization
can be useful when a compression job only has small amount of data to compress.
Yann Collet [Tue, 16 Jan 2018 23:28:43 +0000 (15:28 -0800)]
ZSTDMT can now work in non-blocking mode with 1 thread
it still fallbacks to single-thread blocking invocation
when input is small (<1job)
or when invoking ZSTDMT_compress(), which is blocking.
Also : fixed a bug in new block-granular compression routine.
Yann Collet [Tue, 16 Jan 2018 20:54:33 +0000 (12:54 -0800)]
Merge branch 'dev' into progressiveMT
Yann Collet [Tue, 16 Jan 2018 20:37:44 +0000 (12:37 -0800)]
Merge pull request #956 from terrelln/mf-struct
Split ZSTD_CCtx into smaller sub-structures
Yann Collet [Tue, 16 Jan 2018 19:52:32 +0000 (11:52 -0800)]
Merge pull request #987 from facebook/checkTag
Check tag
Yann Collet [Tue, 16 Jan 2018 19:50:16 +0000 (11:50 -0800)]
ensure MOREFLAGS are not lost in root->tests Makefile invocation
Yann Collet [Tue, 16 Jan 2018 19:40:42 +0000 (11:40 -0800)]
travis ci : added gcc-7 test
also added `-Werror` to sanitizer tests
Nick Terrell [Fri, 12 Jan 2018 20:06:10 +0000 (12:06 -0800)]
Reorganize block state
Nick Terrell [Wed, 13 Dec 2017 00:51:00 +0000 (16:51 -0800)]
Split ZSTD_CCtx into smaller sub-structures
Yann Collet [Tue, 16 Jan 2018 02:55:21 +0000 (18:55 -0800)]
Merge pull request #990 from krab/dev-cmake-libdir
CMake: use GNUInstallDirs for library install dir
Alexey Ivanov [Mon, 15 Jan 2018 19:48:46 +0000 (22:48 +0300)]
CMake: use GNUInstallDirs for library install dir
Libraries now will be installed in the correct directory on x86_64 linux systems,
and can be changed with `-DCMAKE_INSTALL_LIBDIR=<dirname>` option.
Yann Collet [Mon, 15 Jan 2018 01:06:21 +0000 (17:06 -0800)]
added tag-triggered test
ensure tag and libzstd version are compatible
Yann Collet [Mon, 15 Jan 2018 01:03:45 +0000 (17:03 -0800)]
added tests/checkTag
compared provided tag with current libzstd version
Yann Collet [Sun, 14 Jan 2018 22:09:17 +0000 (14:09 -0800)]
make -C tests legacy : minor flag alteration
ZSTD_LEGACY_SUPPORT is a macro constant,
so it should be part of CPPFLAGS, instead of CFLAGS
Yann Collet [Sun, 14 Jan 2018 06:00:05 +0000 (22:00 -0800)]
tests/Makefile : fixed target allnothread
ensures MT is disabled
Yann Collet [Sun, 14 Jan 2018 05:54:21 +0000 (21:54 -0800)]
added `make list` capability to `tests/Makefile`
Yann Collet [Sat, 13 Jan 2018 21:20:42 +0000 (13:20 -0800)]
Merge pull request #984 from terrelln/dict-load
Load more dictionary positions into table if empty
Yann Collet [Sat, 13 Jan 2018 21:18:57 +0000 (13:18 -0800)]
zstdmt : can compress at block granularity
offering perspective of more accurate progression report.
Nick Terrell [Fri, 12 Jan 2018 20:26:47 +0000 (12:26 -0800)]
Load more dictionary positions into table if empty
If the hash table is empty load positions into the hash table
that we would otherwise skip.
| Level | Data Set | Improvement |
|-------|--------------|-------------|
| 1 | github | 0.44% |
| 1 | hg-changelog | 0.13% |
| 1 | hg-commands | 1.28% |
| 1 | hg-manifest | 0.70% |
| 3 | github | 0.74% |
| 3 | hg-changelog | 0.87% |
| 3 | hg-commands | 1.74% |
| 3 | hg-manifest | 0.23% |
Yann Collet [Fri, 12 Jan 2018 15:47:43 +0000 (07:47 -0800)]
Merge pull request #983 from terrelln/dict-wlog
Increase windowLog from CDict based on the srcSize when known
Yann Collet [Fri, 12 Jan 2018 15:28:59 +0000 (07:28 -0800)]
Merge pull request #970 from facebook/dubtlazy
Delayed update Binary Tree for Lazy strategy
Nick Terrell [Fri, 12 Jan 2018 00:45:16 +0000 (16:45 -0800)]
Add test for cdict window log adjustment
Nick Terrell [Thu, 11 Jan 2018 22:35:04 +0000 (14:35 -0800)]
Increase windowLog from CDict based on the srcSize when known
Yann Collet [Thu, 11 Jan 2018 21:25:08 +0000 (13:25 -0800)]
Merge branch 'dev' into dubtlazy
and fixed conflicts
Yann Collet [Thu, 11 Jan 2018 21:20:59 +0000 (13:20 -0800)]
Merge pull request #982 from facebook/fix304
Fix for #304 and #977 : error during dictionary creation
Yann Collet [Thu, 11 Jan 2018 20:38:31 +0000 (12:38 -0800)]
changed function name to ZSTD_DUBT_findBestMatch()
Yann Collet [Thu, 11 Jan 2018 19:40:07 +0000 (11:40 -0800)]
Merge pull request #981 from facebook/fix976
fixed bug #976, reported by @indygreg
Yann Collet [Thu, 11 Jan 2018 19:29:28 +0000 (11:29 -0800)]
added warning message
when pathological dataset is detected
(note : cover_optimize needs -v to display the warning)
Yann Collet [Thu, 11 Jan 2018 19:16:32 +0000 (11:16 -0800)]
fixed #304
Pathological samples may result in literal section being incompressible.
This case is now detected,
and literal distribution is replaced by one that can be written into the dictionary.
Yann Collet [Thu, 11 Jan 2018 17:42:38 +0000 (09:42 -0800)]
added a test case for dictBuilder failure
cyclic data set makes the entropy stage fails
now, onto a fix for #304 ...
Yann Collet [Thu, 11 Jan 2018 16:33:35 +0000 (08:33 -0800)]
Merge pull request #980 from conor42/dev
Fix break condition in decompression noise test
Yann Collet [Thu, 11 Jan 2018 12:49:19 +0000 (04:49 -0800)]
fixed minor warning on prototype definition
Yann Collet [Thu, 11 Jan 2018 04:33:45 +0000 (20:33 -0800)]
fixed bug #976, reported by @indygreg
constants in zstd.h should not depend on MIN() macro which existence is not guaranteed.
Added a test to check the specific constants.
The test is a bit too specific.
But I have found no way to control a more generic "are all macro already defined" condition,
especially as this is a valid construction (the missing macro might be defined later, intentionnally).
conor42 [Thu, 11 Jan 2018 01:42:58 +0000 (11:42 +1000)]
Fix break condition in decompression noise test
The bug prevents noise being added
Yann Collet [Thu, 11 Jan 2018 01:39:37 +0000 (17:39 -0800)]
Merge pull request #979 from facebook/memdoc
Update API documentation related to memory management capabilities
Yann Collet [Wed, 10 Jan 2018 18:02:48 +0000 (19:02 +0100)]
Merge pull request #974 from terrelln/dstfile
[fileio] Improve safety of output file modifications
Yann Collet [Wed, 10 Jan 2018 17:07:47 +0000 (09:07 -0800)]
api doc : grouped all ZSTD_create*_advanced() functions together
in a new "custom memory allocator" paragraph
which is itself part of "memory management" category.
This makes it simpler to see the relation between the type and its usages.
Yann Collet [Wed, 10 Jan 2018 16:47:19 +0000 (08:47 -0800)]
API doc : grouped ZSTD_initStatic*() together
within "memory management" category.
Yann Collet [Sat, 6 Jan 2018 19:50:36 +0000 (20:50 +0100)]
fixed msan test
a pointer calculation was wrong in a corner case
Yann Collet [Sat, 6 Jan 2018 12:15:53 +0000 (13:15 +0100)]
Merge pull request #965 from facebook/tests_obj
%.o objects files in /tests
Yann Collet [Sat, 6 Jan 2018 11:40:58 +0000 (12:40 +0100)]
Merge branch 'dev' into dubtlazy
Yann Collet [Sat, 6 Jan 2018 11:31:26 +0000 (12:31 +0100)]
fixed ZSTD_reduceIndex()
following suggestions from @terrelln.
Also added some comments to present logic behind ZSTD_preserveUnsortedMark().
Yann Collet [Sat, 6 Jan 2018 06:13:09 +0000 (07:13 +0100)]
minor tests/Makefile change, as suggested by @terrelln
https://github.com/facebook/zstd/pull/965#discussion_r160008006
Yann Collet [Sat, 6 Jan 2018 05:57:02 +0000 (06:57 +0100)]
Merge pull request #963 from facebook/benchfix
fix: bench can accept hlog custom parameter
Nick Terrell [Fri, 5 Jan 2018 19:49:55 +0000 (11:49 -0800)]
[fileio] Don't call FIO_remove() on stdout or /dev/null
Nick Terrell [Fri, 5 Jan 2018 19:44:45 +0000 (11:44 -0800)]
[fileio] Use FIO_remove() everywhere for safety
Nick Terrell [Fri, 5 Jan 2018 19:44:25 +0000 (11:44 -0800)]
[util] Refuse to set file stat on non-regular file
Yann Collet [Thu, 4 Jan 2018 11:14:50 +0000 (12:14 +0100)]
Merge pull request #972 from pixelb/bz1530049
zstd: fix crash when not overwriting existing files
Yann Collet [Thu, 4 Jan 2018 11:14:36 +0000 (12:14 +0100)]
Merge pull request #973 from terrelln/test-case
Add test case for PR #972
Nick Terrell [Wed, 3 Jan 2018 22:02:44 +0000 (14:02 -0800)]
Add test case for PR #972