9379 Commits

Author SHA1 Message Date
Nick Terrell
f343f27d17
Merge pull request #2857 from ko-zu/noexecstack
Remove executable flag from GNU_STACK segment
2021-11-16 14:37:56 -08:00
Nick Terrell
b7d899d99d
Merge pull request #2864 from terrelln/linux-opt
[linux-kernel] Don't inline function in zstd_opt.c
2021-11-16 14:13:39 -08:00
Nick Terrell
19eb459da3 [linux-kernel] Don't inline function in zstd_opt.c
The optimal parser is unlikely to be used in the linux kernel in
practice. There is no reason these functions should be force inlined,
since we aren't gaining anything, and are losing build size.

| Compiler | Before (Bytes) | After (Bytes) | Delta (Bytes) |
|----------|----------------|---------------|---------------|
| gcc-11   |        1142090 |        952754 |       -189336 |
| clang-12 |        1228402 |        976290 |       -252112 |

This is a temporary solution pending the resolution of PR #2862 in the
`dev` branch.
2021-11-15 20:37:30 -08:00
Nick Terrell
8dba88c3f6
Merge pull request #2863 from terrelln/fast-dfast-size
Reduce function size in fast & dfast
2021-11-15 20:15:22 -08:00
Nick Terrell
802ea885ef Reduce function size in fast & dfast
Take the same approach as in PR #2828 [0] to remove functions that force
inline many function bodies and `switch`. Instead, create one function per
"template" combination, and then switch between these functions. This
allows the compiler to break the large function into many small
functions, which generally helps codegen.

Also, in the `extDict` modes when there is no ext-dict, call the top
level function instead of the force inlined one, to save on code size.

I'm specifically doing this because gcc on the parisc architecture doesn't
handle the large function body well, and ends up using a lot of excess
stack space. Outlining these functions fixes it.
2021-11-15 19:05:48 -08:00
Lvv.me
81b96205af
Using module.modulemap replace symbol link for public header 2021-11-15 13:23:50 +08:00
Lvv.me
27455638aa
Support Swift Package Manager 2021-11-14 17:29:33 +08:00
ko-zu
c67e07f34e Remove executable flag from GNU_STACK section
Putting stack marking into every assembly files is required to indicate
that the stack does not need to be executable.
Executable flag on stack conflicts with some security measures, Systemd
MemoryDenyWriteExecute=yes for example.
2021-11-13 22:58:33 +09:00
Dimitris Apostolou
ebbd675998
Fix typos 2021-11-13 10:04:04 +02:00
Yann Collet
ddae153947
Merge pull request #2847 from Svetlitski-FB/improve-verbose-output-2
Display command line parameters with concrete values in verbose mode
2021-11-12 18:51:18 -08:00
Kevin Svetlitski
9b28c26cbf Integrate verbose mode tests into playTests.sh 2021-11-12 14:10:21 -08:00
Kevin Svetlitski
7fbd126e08 Suppress spurious unused parameter warning 2021-11-12 10:44:26 -08:00
Kevin Svetlitski
375e3aad6c Ensure formatting directives for displaying size_t are portable 2021-11-11 13:17:32 -08:00
Kevin Svetlitski
365c91194c Ensure print*CParams functions are only defined when used 2021-11-11 12:14:56 -08:00
Kevin Svetlitski
f6ffd39230 Add test case for detailed compression parameter verbose output 2021-11-11 11:59:54 -08:00
Yann Collet
9ba07907c8
Merge pull request #2836 from animalize/copy16
ZSTD_copy16() uses ZSTD_memcpy()
2021-11-11 07:53:08 -08:00
Kevin Svetlitski
df9b7755cb Fix const-ness of FIO_displayCompressionParameters 2021-11-10 17:25:27 -08:00
Kevin Svetlitski
63fe6198ed Display --zstd= subparameters in command-line ready form in verbose mode 2021-11-10 17:20:43 -08:00
Felix Handte
a071e00696
Merge pull request #2850 from felixhandte/oss-fuzz-fix-40829-for-real-this-time
Fix Determinism Bug: Avoid Reducing Indices to Reserved Values
2021-11-10 12:00:43 -05:00
binhdvo
931778ed9b
Fix fullbench CI failure (#2851) 2021-11-09 15:15:35 -05:00
W. Felix Handte
48572f52b1 Rewrite Fix to Still Auto-Vectorize 2021-11-09 12:17:03 -05:00
W. Felix Handte
61765cacd0 Avoid Reducing Indices to Reserved Values
Previously, if an index was equal to `reducerValue + 1`, it would get remapped
during index reduction to 1 i.e. `ZSTD_DUBT_UNSORTED_MARK`. This can affect the
parsing of the input slightly, by causing tree nodes to be nullified when they
otherwise wouldn't be. This hardly matters from a correctness or efficiency
perspective, but it does impact determinism.

So this commit changes index reduction to avoid mapping indices to collide with
`ZSTD_DUBT_UNSORTED_MARK`.
2021-11-08 20:03:52 -05:00
Nick Terrell
793b6cec73
Merge pull request #2849 from terrelln/linux-kernel-backport
Backport zstd patch from LKML
2021-11-05 15:02:37 -07:00
Nick Terrell
d46995efeb Backport zstd patch from LKML
Credit to Nathan Chancellor for the bug fix and Nick Desaulniers for the
bug report.

Link: https://github.com/ClangBuiltLinux/linux/issues/1486
Link: https://lore.kernel.org/all/20211021202353.2356400-1-nathan@kernel.org/
2021-11-05 14:09:49 -07:00
sen
379c62a7d4
Merge pull request #2846 from senhuang42/fix_appveyor
Use unused functions to appease Visual Studio
2021-11-05 23:24:25 +03:00
Kevin Svetlitski
0665d4c1c2 Display command line parameters with concrete values in verbose mode 2021-11-05 12:01:20 -07:00
Yann Collet
5375d75c55
Merge pull request #2839 from Svetlitski-FB/improve-verbose-output
Improvements to verbose mode output - decompression memory usage
2021-11-04 18:26:42 -07:00
Kevin Svetlitski
b3888193d9 Report memory required to decompress while compressing in verbose mode 2021-11-04 16:25:40 -07:00
senhuang42
384744888e Void out unused functions 2021-11-04 14:32:07 +03:00
Ma Lin
b10357ce65 ZSTD_copy16() uses SSE2 instructions
This accelerates the decompression speed of MSVC build.
2021-11-04 11:37:10 +08:00
binhdvo
b399b47467
Move mingw tests from appveyor to github actions (#2838) 2021-11-02 13:17:55 -04:00
binhdvo
04734ee84a
Fix oss fuzz test error (#2837) 2021-10-29 10:29:50 -04:00
Yann Collet
23dd28df67 minor improvements to benchmark display 2021-10-26 23:23:30 -07:00
Yann Collet
aba88fa996
Merge pull request #2829 from facebook/ZSTD_DECODER_INTERNAL_BUFFER
minor : change build macro to ZSTD_DECODER_INTERNAL_BUFFER
2021-10-26 10:48:16 -07:00
Yann Collet
2b2a5c449a fix minor cast warning 2021-10-26 08:38:17 -07:00
Yann Collet
518f06b281 added minimum for decoder buffer
also : introduced macro BOUNDED()
2021-10-26 08:21:31 -07:00
Yann Collet
12e177cba8
Merge pull request #2830 from facebook/clevels
separate compression level tables into their own file
2021-10-25 13:35:54 -07:00
Nick Terrell
ad739e5959
Merge pull request #2828 from terrelln/lazy-compile
[lazy] Speed up compilation times
2021-10-25 10:22:23 -07:00
Yann Collet
082d6c6775 separate compression level tables into their own files
that's clearer than finding the tables somewhere in the middle of `compress.c`.

Also, down the line, it may potentially allows zstd to feature adjusted tables depending on target cpu.
2021-10-25 08:49:54 -07:00
Yann Collet
02be2a830f build macro ZSTD_DECODER_INTERNAL_BUFFER
just to make the topic more accessible for potential users.
2021-10-25 08:09:04 -07:00
binhdvo
6a7ede3dfc
Reduce size of dctx by reutilizing dst buffer (#2751)
* Reduce size of dctx by reutilizing dst buffer

Co-authored-by: Binh Vo <binhvo@fb.com>
2021-10-25 10:38:01 -04:00
Yann Collet
0a794f5afe
Merge pull request #2822 from marxin/fix-zstd-thread-pool-documentation
Support thread pool section in HTML documentation.
2021-10-22 16:46:08 -07:00
Nick Terrell
13cad3abb1 [lazy] Speed up compilation times
Speed up compilation times by moving each specialized search function
into its own function. This is faster because compilers can handle many
smaller functions much faster than one gigantic function. The previous
approach generated one giant function with `switch` statements and
inlining to select the implementation.

| Compiler | Flags                               | Dev Time (s) | PR Time (s) | Delta |
|----------|-------------------------------------|--------------|-------------|-------|
| gcc      | -O3                                 |         16.5 |         5.6 |  -66% |
| gcc      | -O3 -g -fsanitize=address,undefined |        158.9 |        38.2 |  -75% |
| clang    | -O3                                 |         36.5 |         5.5 |  -85% |
| clang    | -O3 -g -fsanitize=address,undefined |         27.8 |        17.5 |  -37% |

This also reduces the binary size because the search functions are no
longer inlined into the main body.

| Compiler | Dev libzstd.a Size (B) | PR libzstd.a Size (B) | Delta |
|----------|------------------------|-----------------------|-------|
| gcc      |                1563868 |               1308844 |  -16% |
| clang    |                1924372 |               1376020 |  -28% |

Finally, the performance is not impacted significantly by this change,
in fact we generally see a small speed boost.

| Compiler | Level | Dev Speed (MB/s) | PR Speed (MB/s) | Delta |
|----------|-------|------------------|-----------------|-------|
| gcc      |     5 |            110.6 |           110.0 | -0.5% |
| gcc      |     7 |             70.4 |            72.2 | +2.5% |
| gcc      |     9 |             53.2 |            53.5 | +0.5% |
| gcc      |    13 |             12.7 |            12.9 | +1.5% |
| clang    |     5 |            113.9 |           110.4 | -3.0% |
| clang    |     7 |             67.7 |            70.6 | +4.2% |
| clang    |     9 |             51.9 |            52.2 | +0.5% |
| clang    |    13 |             12.4 |            13.3 | +7.2% |

The compression strategy is unmodified in this PR, so the compressed size
should be exactly the same. I may have a follow up PR to slightly improve
the compression ratio, if it doesn't cost too much speed.
2021-10-22 13:45:26 -07:00
Nick Terrell
dad8a3cf34
Merge pull request #2825 from terrelln/huf-asm-comments
[asm] Switch to C style comments
2021-10-20 18:06:37 -07:00
Nick Terrell
abd717a5fa [asm] Switch to C style comments
Switch to C style comments for increased portability, and consistency.
2021-10-20 11:37:05 -07:00
Yann Collet
9d62957b31
Merge pull request #2800 from animalize/fix_c89
Fix a C89 error in msvc
2021-10-18 14:32:04 -07:00
Martin Liska
1c2b02eee9 Support thread pool section in HTML documentation. 2021-10-15 18:35:39 +02:00
Felix Handte
23c1a2d260
Merge pull request #2774 from felixhandte/zstd-dfast-pipelined-single
Pipelined Implementation of ZSTD_dfast
2021-10-13 16:38:43 -04:00
W. Felix Handte
0bfc935add Convert Outer Control Structure to Loop 2021-10-12 13:34:17 -04:00
sen
66e554fdad
Merge pull request #2813 from marxin/streaming-compress-enhance
Enhance streaming_compression examples.
2021-10-12 13:05:54 -04:00