]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
7 years agoUpdate zstd.1 1005/head
systemcrash [Mon, 29 Jan 2018 17:38:02 +0000 (18:38 +0100)] 
Update zstd.1

7 years agobumped version number to v1.3.4
Yann Collet [Sun, 28 Jan 2018 06:23:26 +0000 (22:23 -0800)] 
bumped version number to v1.3.4

also added a paragraph on using compression level with training mode
as this is a recurrent question (see for example #1004)

7 years agoMerge pull request #1001 from ne-sted/fix-defaults-align
Yann Collet [Wed, 24 Jan 2018 17:34:36 +0000 (09:34 -0800)] 
Merge pull request #1001 from ne-sted/fix-defaults-align

cli: fix align of defaults

7 years agocli: fix align of defaults 1001/head
ne-sted [Wed, 24 Jan 2018 12:59:44 +0000 (14:59 +0200)] 
cli: fix align of defaults

7 years agoMerge pull request #998 from facebook/zcat
Yann Collet [Tue, 23 Jan 2018 20:01:25 +0000 (12:01 -0800)] 
Merge pull request #998 from facebook/zcat

add `zcat` symlink support, suggested by @wtarreau

7 years agoadd `zcat` symlink support, suggested by @wtarreau 998/head
Yann Collet [Fri, 19 Jan 2018 19:26:35 +0000 (11:26 -0800)] 
add `zcat` symlink support, suggested by @wtarreau

added some test
also updated relevant doc

+ fixed a mistake in `lz4` symlink support :
  lz4 utility doesn't remove source files by default (like zstd, but unlike gzip).
  The symlink must behave the same.

7 years agoMerge pull request #995 from facebook/progressiveMT
Yann Collet [Fri, 19 Jan 2018 01:59:49 +0000 (17:59 -0800)] 
Merge pull request #995 from facebook/progressiveMT

Progressive mt

7 years agoMerge pull request #994 from facebook/constCDict
Yann Collet [Fri, 19 Jan 2018 01:57:53 +0000 (17:57 -0800)] 
Merge pull request #994 from facebook/constCDict

changed initStatic?Dict() return type to const ZSTD_?Dict*

7 years agoMerge branch 'dev' into constCDict 994/head
Yann Collet [Thu, 18 Jan 2018 21:36:43 +0000 (13:36 -0800)] 
Merge branch 'dev' into constCDict

7 years agoMerge branch 'dev' into progressiveMT 995/head
Yann Collet [Thu, 18 Jan 2018 21:34:56 +0000 (13:34 -0800)] 
Merge branch 'dev' into progressiveMT

7 years agoMerge pull request #997 from terrelln/empty-dict
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

7 years agoSet repcodes for empty ZSTD_CDict 997/head
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.

7 years agofileio: READY_FOR_UPDATE() is now a function-like macro
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

7 years agofixes for @terrelln comments
Yann Collet [Thu, 18 Jan 2018 19:15:23 +0000 (11:15 -0800)] 
fixes for @terrelln comments

7 years agofixed a few access contention
Yann Collet [Thu, 18 Jan 2018 01:18:19 +0000 (17:18 -0800)] 
fixed a few access contention

passes thread sanitizer test

7 years agoIntroduce ZSTD_getFrameProgression()
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.

7 years agoMerge pull request #991 from facebook/progressiveMT
Yann Collet [Wed, 17 Jan 2018 22:35:23 +0000 (14:35 -0800)] 
Merge pull request #991 from facebook/progressiveMT

Non-blocking compression

7 years agochanged initStatic?Dict() return type to const ZSTD_?Dict*
Yann Collet [Wed, 17 Jan 2018 22:08:48 +0000 (14:08 -0800)] 
changed initStatic?Dict() return type to const ZSTD_?Dict*

ZSTD_create?Dict() is required to produce a ?Dict* return type
because `free()` does not accept a `const type*` argument.
If it wasn't for this restriction, I would have preferred to create a `const ?Dict*` object
to emphasize the fact that, once created, a dictionary never changes
(hence can be shared concurrently until the end of its lifetime).

There is no such limitation with initStatic?Dict() :
as stated in the doc, there is no corresponding free() function,
since `workspace` is provided, hence allocated, externally,
it can only be free() externally.

Which means, ZSTD_initStatic?Dict() can return a `const ZSTD_?Dict*` pointer.

Tested with `make all`, to catch initStatic's users,
which, incidentally, also updated zstd.h documentation.

7 years agoMerge pull request #993 from krab/dev-cmake-windows-mt
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

7 years agoMerge branch 'dev' into progressiveMT 991/head
Yann Collet [Wed, 17 Jan 2018 21:51:03 +0000 (13:51 -0800)] 
Merge branch 'dev' into progressiveMT

fixed minor conflict on cdict

7 years agoMerge pull request #992 from terrelln/small-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

7 years agozstdmt : fixed very large window sizes
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.

7 years agozstdmt: fixed an endless loop on allocation failure
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)

7 years agoReduce size of ZSTD_CDict 992/head
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   |

7 years agozstdmt: minor variable renaming, for clarity
Yann Collet [Wed, 17 Jan 2018 19:39:07 +0000 (11:39 -0800)] 
zstdmt: minor variable renaming, for clarity

7 years agoCMake: fixed multithreading build on Windows 993/head
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>
7 years agofix fileio progression status update
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.

7 years agocli: fix for no-MT mode
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).

7 years agointroduced parameter ZSTD_p_nonBlockingMode
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

7 years agoZSTDMT : minor CCtx memory optimization
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.

7 years agoZSTDMT can now work in non-blocking mode with 1 thread
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.

7 years agoMerge branch 'dev' into progressiveMT
Yann Collet [Tue, 16 Jan 2018 20:54:33 +0000 (12:54 -0800)] 
Merge branch 'dev' into progressiveMT

7 years agoMerge pull request #956 from terrelln/mf-struct
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

7 years agoMerge pull request #987 from facebook/checkTag
Yann Collet [Tue, 16 Jan 2018 19:52:32 +0000 (11:52 -0800)] 
Merge pull request #987 from facebook/checkTag

Check tag

7 years agoensure MOREFLAGS are not lost in root->tests Makefile invocation
Yann Collet [Tue, 16 Jan 2018 19:50:16 +0000 (11:50 -0800)] 
ensure MOREFLAGS are not lost in root->tests Makefile invocation

7 years agotravis ci : added gcc-7 test
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

7 years agoReorganize block state 956/head
Nick Terrell [Fri, 12 Jan 2018 20:06:10 +0000 (12:06 -0800)] 
Reorganize block state

7 years agoSplit ZSTD_CCtx into smaller sub-structures
Nick Terrell [Wed, 13 Dec 2017 00:51:00 +0000 (16:51 -0800)] 
Split ZSTD_CCtx into smaller sub-structures

7 years agoMerge pull request #990 from krab/dev-cmake-libdir
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

7 years agoCMake: use GNUInstallDirs for library install dir 990/head
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.

7 years agoadded tag-triggered test 987/head
Yann Collet [Mon, 15 Jan 2018 01:06:21 +0000 (17:06 -0800)] 
added tag-triggered test

ensure tag and libzstd version are compatible

7 years agoadded tests/checkTag
Yann Collet [Mon, 15 Jan 2018 01:03:45 +0000 (17:03 -0800)] 
added tests/checkTag

compared provided tag with current libzstd version

7 years agomake -C tests legacy : minor flag alteration
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

7 years agotests/Makefile : fixed target allnothread
Yann Collet [Sun, 14 Jan 2018 06:00:05 +0000 (22:00 -0800)] 
tests/Makefile : fixed target allnothread

ensures MT is disabled

7 years agoadded `make list` capability to `tests/Makefile`
Yann Collet [Sun, 14 Jan 2018 05:54:21 +0000 (21:54 -0800)] 
added `make list` capability to `tests/Makefile`

7 years agoMerge pull request #984 from terrelln/dict-load
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

7 years agozstdmt : can compress at block granularity
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.

7 years agoLoad more dictionary positions into table if empty 984/head
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%       |

7 years agoMerge pull request #983 from terrelln/dict-wlog
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

7 years agoMerge pull request #970 from facebook/dubtlazy
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

7 years agoAdd test for cdict window log adjustment 983/head
Nick Terrell [Fri, 12 Jan 2018 00:45:16 +0000 (16:45 -0800)] 
Add test for cdict window log adjustment

7 years agoIncrease windowLog from CDict based on the srcSize when known
Nick Terrell [Thu, 11 Jan 2018 22:35:04 +0000 (14:35 -0800)] 
Increase windowLog from CDict based on the srcSize when known

7 years agoMerge branch 'dev' into dubtlazy 970/head
Yann Collet [Thu, 11 Jan 2018 21:25:08 +0000 (13:25 -0800)] 
Merge branch 'dev' into dubtlazy

and fixed conflicts

7 years agoMerge pull request #982 from facebook/fix304
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

7 years agochanged function name to ZSTD_DUBT_findBestMatch()
Yann Collet [Thu, 11 Jan 2018 20:38:31 +0000 (12:38 -0800)] 
changed function name to ZSTD_DUBT_findBestMatch()

7 years agoMerge pull request #981 from facebook/fix976
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

7 years agoadded warning message 982/head
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)

7 years agofixed #304
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.

7 years agoadded a test case for dictBuilder failure
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 ...

7 years agoMerge pull request #980 from conor42/dev
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

7 years agofixed minor warning on prototype definition 981/head
Yann Collet [Thu, 11 Jan 2018 12:49:19 +0000 (04:49 -0800)] 
fixed minor warning on prototype definition

7 years agofixed bug #976, reported by @indygreg
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).

7 years agoFix break condition in decompression noise test 980/head
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

7 years agoMerge pull request #979 from facebook/memdoc
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

7 years agoMerge pull request #974 from terrelln/dstfile
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

7 years agoapi doc : grouped all ZSTD_create*_advanced() functions together 979/head
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.

7 years agoAPI doc : grouped ZSTD_initStatic*() together
Yann Collet [Wed, 10 Jan 2018 16:47:19 +0000 (08:47 -0800)] 
API doc : grouped ZSTD_initStatic*() together

within "memory management" category.

7 years agofixed msan test
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

7 years agoMerge pull request #965 from facebook/tests_obj
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

7 years agoMerge branch 'dev' into dubtlazy
Yann Collet [Sat, 6 Jan 2018 11:40:58 +0000 (12:40 +0100)] 
Merge branch 'dev' into dubtlazy

7 years agofixed ZSTD_reduceIndex()
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().

7 years agominor tests/Makefile change, as suggested by @terrelln 965/head
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

7 years agoMerge pull request #963 from facebook/benchfix
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

7 years ago[fileio] Don't call FIO_remove() on stdout or /dev/null 974/head
Nick Terrell [Fri, 5 Jan 2018 19:49:55 +0000 (11:49 -0800)] 
[fileio] Don't call FIO_remove() on stdout or /dev/null

7 years ago[fileio] Use FIO_remove() everywhere for safety
Nick Terrell [Fri, 5 Jan 2018 19:44:45 +0000 (11:44 -0800)] 
[fileio] Use FIO_remove() everywhere for safety

7 years ago[util] Refuse to set file stat on non-regular file
Nick Terrell [Fri, 5 Jan 2018 19:44:25 +0000 (11:44 -0800)] 
[util] Refuse to set file stat on non-regular file

7 years agoMerge pull request #972 from pixelb/bz1530049
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

7 years agoMerge pull request #973 from terrelln/test-case
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

7 years agoAdd test case for PR #972 973/head
Nick Terrell [Wed, 3 Jan 2018 22:02:44 +0000 (14:02 -0800)] 
Add test case for PR #972

7 years agozstd: fix crash when not overwriting existing files 972/head
Pádraig Brady [Tue, 2 Jan 2018 15:17:32 +0000 (15:17 +0000)] 
zstd: fix crash when not overwriting existing files

This fixes the following crash:
  $ touch exists
  $ programs/zstd -r examples/ -o exists
  zstd: exists already exists; not overwritten
  Segmentation fault (core dumped)

* programs/fileio.c (FIO_compressMultipleFilenames):
Handle the case where we're not overwriting the destination.

Reported at https://bugzilla.redhat.com/1530049

7 years agoupdated /lib documentation
Yann Collet [Sun, 31 Dec 2017 14:50:00 +0000 (15:50 +0100)] 
updated /lib documentation

7 years agoMerge pull request #968 from shawnl/dev
Yann Collet [Sat, 30 Dec 2017 15:16:37 +0000 (16:16 +0100)] 
Merge pull request #968 from shawnl/dev

meson: get soversion right

7 years agofixed minor argument property for Visual
Yann Collet [Sat, 30 Dec 2017 14:42:28 +0000 (15:42 +0100)] 
fixed minor argument property for Visual

7 years agoMerge branch 'dubtlazy' of github.com:facebook/zstd into dubtlazy
Yann Collet [Sat, 30 Dec 2017 14:21:18 +0000 (15:21 +0100)] 
Merge branch 'dubtlazy' of github.com:facebook/zstd into dubtlazy

7 years agoimproved btlazy2 : list of unsorted candidates can reach extDict
Yann Collet [Sat, 30 Dec 2017 14:12:59 +0000 (15:12 +0100)] 
improved btlazy2 : list of unsorted candidates can reach extDict

It used to stop on reaching extDict, for simplification.
As a consequence, there was a small loss of performance each time the round buffer would restart from beginning.
It's not a large difference though, just several hundreds of bytes on silesia.
This patch fixes it.

7 years agoupdated compression level table for btlazy2
Yann Collet [Sat, 30 Dec 2017 10:37:18 +0000 (11:37 +0100)] 
updated compression level table for btlazy2

now selected for levels 13, 14 and 15.

Also : dropped the requirement for monotonic memory budget increase of compression levels,,
which was required for ZSTD_estimateCCtxSize()
in order to ensure that a memory budget for level L is large enough for any level <= L.
This condition is now ensured at run time inside ZSTD_estimateCCtxSize().

7 years agoupdated compression level table for btlazy2
Yann Collet [Sat, 30 Dec 2017 10:37:18 +0000 (11:37 +0100)] 
updated compression level table for btlazy2

now selected for levels 13, 14 and 15.

Also : dropped the requirement for monotonic memory budget increase of compression levels,,
which was required for ZSTD_estimateCCtxSize()
in order to ensure that a memory budget for level L is large enough for any level <= L.
This condition is now ensured at run time inside ZSTD_estimateCCtxSize().

7 years agosimplify ZSTD_preserveUnsortedMark() implementation
Yann Collet [Sat, 30 Dec 2017 10:13:52 +0000 (11:13 +0100)] 
simplify ZSTD_preserveUnsortedMark() implementation

since no compiler attempts to auto-vectorize it.

7 years agomeson: allow -Dlegacy_support=true, fix -Dlegacy_support=0 968/head
Shawn Landden [Mon, 25 Dec 2017 00:01:15 +0000 (16:01 -0800)] 
meson: allow -Dlegacy_support=true, fix -Dlegacy_support=0

7 years agoMerge branch 'benchfix' into dubtlazy
Yann Collet [Fri, 29 Dec 2017 18:16:58 +0000 (19:16 +0100)] 
Merge branch 'benchfix' into dubtlazy

7 years agobtlazy2 : optimization for dictionary compression
Yann Collet [Fri, 29 Dec 2017 18:14:18 +0000 (19:14 +0100)] 
btlazy2 : optimization for dictionary compression

we want the dictionary table to be fully sorted,
not just lazily filled.
Dictionary loading is a bit more intensive,
but it saves cpu cycles for match search during compression.

7 years agobtlazy2: fixed interaction between unsortedMark and reduceTable
Yann Collet [Fri, 29 Dec 2017 18:08:51 +0000 (19:08 +0100)] 
btlazy2: fixed interaction between unsortedMark and reduceTable

7 years agoadd test case which reliably produces btlazy2 rescale overflow bug
Yann Collet [Fri, 29 Dec 2017 16:40:36 +0000 (17:40 +0100)] 
add test case which reliably produces btlazy2 rescale overflow bug

The unsorted_mark is handled like any index,
which fails after a rescale.

7 years agofixed bug in dubt
Yann Collet [Fri, 29 Dec 2017 16:04:37 +0000 (17:04 +0100)] 
fixed bug in dubt

the chain of unsorted candidates could grow beyond lowLimit.

7 years agominor speed optimization : index overflow prevention
Yann Collet [Fri, 29 Dec 2017 13:40:33 +0000 (14:40 +0100)] 
minor speed optimization : index overflow prevention

new code supposed to be easier to auto-vectorize

7 years agocomplete ignore list
Yann Collet [Fri, 29 Dec 2017 13:39:49 +0000 (14:39 +0100)] 
complete ignore list

fuzz tests artifacts

7 years agofirst implementation of delayed update for btlazy2
Yann Collet [Thu, 28 Dec 2017 15:58:57 +0000 (16:58 +0100)] 
first implementation of delayed update for btlazy2

This is a pretty nice speed win.

The new strategy consists in stacking new candidates as if it was a hash chain.
Then, only if there is a need to actually consult the chain, they are batch-updated,
before starting the match search itself.
This is supposed to be beneficial when skipping positions,
which happens a lot when using lazy strategy.

The baseline performance for btlazy2 on my laptop is :
15#calgary.tar       :   3265536 ->    955985 (3.416),  7.06 MB/s , 618.0 MB/s
15#enwik7            :  10000000 ->   3067341 (3.260),  4.65 MB/s , 521.2 MB/s
15#silesia.tar       : 211984896 ->  58095131 (3.649),  6.20 MB/s , 682.4 MB/s
(only level 15 remains for btlazy2, as this strategy is squeezed between lazy2 and btopt)

After this patch, and keeping all parameters identical,
speed is increased by a pretty good margin (+30-50%),
but compression ratio suffers a bit :
15#calgary.tar       :   3265536 ->    958060 (3.408),  9.12 MB/s , 621.1 MB/s
15#enwik7            :  10000000 ->   3078318 (3.249),  6.37 MB/s , 525.1 MB/s
15#silesia.tar       : 211984896 ->  58444111 (3.627),  9.89 MB/s , 680.4 MB/s

That's because I kept `1<<searchLog` as a maximum number of candidates to update.
But for a hash chain, this represents the total number of candidates in the chain,
while for the binary, it represents the maximum depth of searches.
Keep in mind that a lot of candidates won't even be visited in the btree,
since they are filtered out by the binary sort.

As a consequence, in the new implementation,
the effective depth of the binary tree is substantially shorter.

To compensate, it's enough to increase `searchLog` value.
Here is the result after adding just +1 to searchLog (level 15 setting in this patch):
15#calgary.tar       :   3265536 ->    956311 (3.415),  8.32 MB/s , 611.4 MB/s
15#enwik7            :  10000000 ->   3067655 (3.260),  5.43 MB/s , 535.5 MB/s
15#silesia.tar       : 211984896 ->  58113144 (3.648),  8.35 MB/s , 679.3 MB/s

aka, almost the same compression ratio as before,
but with a noticeable speed increase (+20-30%).

This modification makes btlazy2 more competitive.
A new round of paramgrill will be necessary to determine which levels are impacted and could adopt the new strategy.

7 years agowindows ci : removed fullbench-dll from appveyor
Yann Collet [Wed, 27 Dec 2017 18:27:54 +0000 (19:27 +0100)] 
windows ci : removed fullbench-dll from appveyor

the test is broken
previous version was too Windows-specific.
It needs to be either refactored to be cross-platform,
or be removed if it doesn't bring any value
(which is indeed unclear).

7 years ago%.o objects files in /tests
Yann Collet [Wed, 27 Dec 2017 16:49:18 +0000 (17:49 +0100)] 
%.o objects files in /tests

Recipe in /tests rebuild everything from source for each target.
zstd is still a "small" project, so it's not prohibitive,
yet, rebuilding same files over and over represents substantial redundant work.

This patch replaces *.c files from /lib by their corresponding *.o files.
They cannot be compiled and stored directly within /lib,
since /tests triggers additional debug capabilities unwelcome in release binary.
So the resulting *.o are stored directly within /tests.

It turns out, it's difficult to find several target using *exactly* the same rules.
Using only the default rules (debug enabled, multi-threading disabled, no legacy)
a surprisingly small amount of targets share their work.

It's because, in many cases there are additional modifications requested :
some targets are 32-bits, some enable multi-threading, some enable legacy support,
some disable asserts, some want different kind of sanitizer, etc.

I created 2 sets of object files : with and without multithreading.
Several targets share their work, saving compilation time when running `make all`.
Also, obviously, when modifying one source file, only this one needs rebuilding.

For targets requiring some different setting, build from source *.c remain the rule.

The new rules have been tested within `-j` parallel compilation, and work fine with it.

7 years agofix: bench can accept hlog custom parameter 963/head
Yann Collet [Wed, 27 Dec 2017 12:32:05 +0000 (13:32 +0100)] 
fix: bench can accept hlog custom parameter

was ignored during initialization