Commit Graph
11725 Commits
Author SHA1 Message Date
Elliot GorokhovskyandGitHub 2a356737d8 Merge pull request #3321 from embg/ldmCparamFix
Complete migration of ZSTD_c_enableLongDistanceMatching to ZSTD_paramSwitch_e framework
2022-11-21 17:37:59 -05:00
Elliot Gorokhovsky bb3c01c853 Migrate other test usages of boolean LDM flag to paramSwitch enum 2022-11-21 16:20:38 -05:00
Elliot Gorokhovsky 3720910d06 Fix fuzzer failure 2022-11-21 16:09:04 -05:00
Elliot Gorokhovsky c8d870fe52 Improve LDM cparam validation logic 2022-11-21 15:39:18 -05:00
Carl Woffenden 0547c3d3f8 Random edit to re-run the CI
I don't believe the (x64) Mac failure is related to error since it would take the SSE path.
2022-11-19 19:04:08 +01:00
Carl Woffenden 0168914490 Fix for MSVC C4267 error 2022-11-18 11:31:17 +01:00
Elliot GorokhovskyandGitHub b1182fe242 Merge pull request #3300 from yiyuaner/dev
Fix the wrong check for buffer overrun in UTIL_mergeFileNamesTable
2022-11-02 15:28:02 -04:00
Felix HandteandGitHub bd4581c311 Merge pull request #3309 from joycebrum/dev
Fix action error by upgrading Scorecard GHA to 2.0.6
2022-11-01 17:53:37 -04:00
Joyce Brum a8f8dc8c5c fix: upgrade scorecard action to 2.0.6
Signed-off-by: Joyce Brum <joycebrum@google.com>
2022-11-01 14:55:31 -03:00
Elliot GorokhovskyandGitHub bb23f7b99b Merge pull request #3304 from GermanAizek/dev
Rewrite check *bufStart condition
2022-11-01 12:45:42 -04:00
appleman4321 5334339421 Rewrite checking condition bufStart pointer NULL 2022-11-01 02:31:09 +03:00
Danielle Rozenblit c2638212af Change threshold for benchmarking 2022-10-27 13:13:17 -07:00
daniellerozenblitandGitHub 0e1de8a205 Merge branch 'facebook:dev' into optimal-huff-depth-speed 2022-10-27 13:22:31 -04:00
Danielle Rozenblit db74d043d6 Speed optimizations with macro 2022-10-27 10:20:44 -07:00
Danielle Rozenblit 401331909e Commit for benchmarking 2022-10-24 12:35:16 -07:00
yiyuaner 361d86998a Fix the wrong check for buffer overrun in UTIL_mergeFileNamesTable 2022-10-24 20:37:15 +08:00
Nick TerrellandNick Terrell 43de2aa17d [contrib][linux] Disable ASM in the kernel
Disable ASM in the kernel for now. It requires a few changes & setup to
get working. Instead of doing it in a zstd version update, I'd prefer to
package that change as a single patch, and propose it separately from
the version update. This makes the version update easier, and reduces
some risk.
2022-10-21 17:14:31 -07:00
Nick TerrellandNick Terrell 330558ad52 [contrib][linux] Add zstd_common module
The zstd_common module was added upstream in commit
https://github.com/torvalds/linux/commit/637a642f5ca5e850186bb64ac75ebb0f124b458d.

But the kernel specific code was inlined into the library. This commit
switches it to use the out of line method that we use for the other
modules.
2022-10-21 17:14:31 -07:00
Nick TerrellandGitHub dcc7228de9 [lazy] Use switch instead of indirect function calls. (#3295)
Use a switch statement to select the search function instead of an
indirect function call. This results in a sizable performance win.

This PR is a modification of the approach taken in PR #2828.
When I measured performance for that commit, it was neutral.
However, I now see a performance regression on gcc, but still
neutral on clang. I'm measuring on the same platform, but with
newer compilers. The new approach beats both the current dev
branch and the baseline before PR #2828 was merged.

This PR is necessary for Issue #3275, to update zstd in the kernel.
Without this PR there is a large regression in greedy - btlazy2
compression speed. With this PR it is about neutral.

gcc version: 12.2.0
clang version: 14.0.6
dataset: silesia.tar

| Compiler | Level | Dev Speed (MB/s) | PR Speed (MB/s) | Delta  |
|----------|-------|------------------|-----------------|--------|
| gcc      |     5 |            102.6 |           113.7 | +10.8% |
| gcc      |     7 |             66.6 |            74.8 | +12.3% |
| gcc      |     9 |             51.5 |            58.9 | +14.3% |
| gcc      |    13 |             14.3 |            14.3 |  +0.0% |
| clang    |     5 |            108.1 |           114.8 |  +6.2% |
| clang    |     7 |             68.5 |            72.3 |  +5.5% |
| clang    |     9 |             53.2 |            56.2 |  +5.6% |
| clang    |    13 |             14.3 |            14.7 |  +2.8% |

The binary size stays just about the same for clang and gcc, measured
using the `size` command:

| Compiler | Branch | Text    | Data | BSS | Total   |
|----------|--------|---------|------|-----|---------|
| gcc      | dev    | 1127950 | 3312 | 280 | 1131542 |
| gcc      | PR     | 1123422 | 2512 | 280 | 1126214 |
| clang    | dev    | 1046254 | 3256 | 216 | 1049726 |
| clang    | PR     | 1048198 | 2296 | 216 | 1050710 |
2022-10-21 17:14:02 -07:00
Miguel OjedaandGitHub 5c1cdba7dd [contrib][linux-kernel] Generate SPDX license identifiers (#3294)
Add a `--spdx` option to the freestanding script to prefix
files with a line like (for `.c` files):

    // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause

or (for `.h` and `.S` files):

    /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */

Given the style of the line to be used depends on the extension,
a simple `sed` insert command would not work.

It also skips the file if an existing SPDX line is there,
as well as raising an error if an unexpected SPDX line appears
anywhere else in the file, as well as for unexpected
file extensions.

I double-checked that all currently generated files appear
to be license as expected with:

    grep -LRF 'This source code is licensed under both the BSD-style license (found in the'  linux/lib/zstd
    grep -LRF 'LICENSE file in the root directory of this source tree) and the GPLv2 (found' linux/lib/zstd

but somebody knowledgable on the licensing of the project should
double-check this is the intended case.

Fixes: https://github.com/facebook/zstd/issues/3293
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-10-18 16:35:44 -07:00
Felix HandteandGitHub 99d239de32 Merge pull request #3290 from felixhandte/ddict-dict-id-from-ddict
Make ZSTD_getDictID_fromDDict() Read DictID from DDict
2022-10-18 13:33:32 -04:00
daniellerozenblitandGitHub 0d5d571080 Merge pull request #3285 from daniellerozenblit/optimal-huff-depth
Optimal huf depth
2022-10-18 10:31:44 -04:00
Daniel KuteninandGitHub 1d153c923c Make fuzzing work without ZSTD_MULTITHREAD (#3291) 2022-10-17 14:31:47 -07:00
Danielle Rozenblit b4f0d364af Merge 2022-10-17 11:24:24 -07:00
Danielle Rozenblit a08fabd51a Rough draft speed optimization 2022-10-17 10:24:29 -07:00
Danielle Rozenblit a910489ff5 No longer pass srcSize to minTableLog 2022-10-17 08:03:44 -07:00
Danielle Rozenblit b34729018c Minor simplication: no longer need to check src size if using cardinality for minTableLog 2022-10-17 07:55:07 -07:00
Nathan Moinvaziri b87f3102ff Only run playTests.sh cmake test if in unix shell environment. 2022-10-15 09:21:14 -07:00
Yann ColletandGitHub e0df910d58 Merge pull request #3288 from facebook/cleanThreadPool
Cleaner threadPool initialization
2022-10-14 23:59:03 -07:00
W. Felix Handte d7841d150b Make ZSTD_getDictID_fromDDict() Read DictID from DDict
Currently this function actually reads the dict ID from the dictionary's
header, via `ZSTD_getDictID_fromDict()`. But during decompression the decomp-
ressor actually compares the dict ID in the frame header with the dict ID in
the DDict. Now of course the dict ID in the dictionary contents and the dict
ID in the DDict struct *should* be the same. But in cases of memory corrupt-
ion, where they can drift out of sync, it's misleading for this function to
read it again from the dict buffer rather then return the dict ID that will
actually be used.

Also doing it this way avoids rechecking the magic and so on and so it is a
tiny bit more efficient.
2022-10-14 22:53:03 -04:00
Danielle Rozenblit 75cd42afd7 Update regression results and better variable naming for HUF_cardinality 2022-10-14 13:37:19 -07:00
Danielle Rozenblit c4853e1553 Update threshold to use optimal depth 2022-10-14 11:29:32 -07:00
Danielle Rozenblit e60cae33cf Additional ratio optimizations 2022-10-14 10:37:35 -07:00
Yann Collet b7d55cfa0d fix issue #3119
fix segfault error when running zstreamtest with MALLOC_PERTURB_
2022-10-12 23:04:23 -07:00
Danielle Rozenblit 117fddcd81 Update regression results 2022-10-12 13:49:44 -07:00
Yann Collet 9abecfbb7e replaced Zstandard by zstd in man page
identified by @paulmenzel in #3286
2022-10-11 23:32:18 -07:00
Danielle Rozenblit 5978627ac1 Merge branch 'optimal-huff-depth' of github.com:daniellerozenblit/zstd into optimal-huff-depth 2022-10-11 14:45:50 -07:00
Danielle Rozenblit fa7d9c1139 Set threshold to use optimal table log 2022-10-11 14:33:25 -07:00
daniellerozenblitandGitHub d880960335 Merge branch 'facebook:dev' into optimal-huff-depth 2022-10-11 16:15:23 -04:00
Danielle Rozenblit 8888a2ddcc CI failure fixes 2022-10-11 13:12:19 -07:00
Dimitri Papadopoulos bc1b40166d Automatically update GitHub Actions in the future 2022-10-10 13:44:57 +02:00
Yann ColletandGitHub b63854b237 Merge pull request #3281 from ilyakurdyukov/patch-1
fixed zstd-pgo target for GCC
2022-10-07 22:56:45 -07:00
Ilya KurdyukovandGitHub 2bd70eff06 zstd-pgo: also clean zstd binary from objects
Just a precaution, because it works anyway.
2022-10-06 00:38:23 +07:00
Ilya KurdyukovandGitHub 2ffcb2d6a8 fixed zstd-pgo target for GCC
Since your Makefile uses obj/$(HASH_DIR) for object files, this code does not work correctly for GCC. Because profiles are saved in one directory, and are expected in another when reading.

`$(RM) zstd *.o` - this line doesn't delete object files.

Clang stores profiles in the current directory, so the problem doesn't appear when compiling with Clang.

Also this code will work if BUILD_DIR is set.
2022-10-05 17:32:16 +07:00
Felix HandteandGitHub 33273e1b9c Merge pull request #3277 from felixhandte/ossf-scorecard
Enable OpenSSF Scorecard Action
2022-10-03 14:33:21 -04:00
W. Felix Handte de9a450c00 Restrict from Running on Forks 2022-10-03 11:23:29 -04:00
Felix Handte 79729f8a2d Create scorecards.yml
Addresses #3269.
2022-09-30 14:30:22 -04:00
Yann ColletandGitHub 096dccbc2d Merge pull request #3273 from MaskRay/deprecated
Move ZSTD_DEPRECATED before ZSTDLIB_API/ZSTDLIB_STATIC_API
2022-09-28 10:30:22 -07:00
Fangrui Song 5635827ede Move ZSTD_DEPRECATED before ZSTDLIB_API/ZSTDLIB_STATIC_API
Clang doesn't allow [[deprecated(...)]] attribute after __attribute__.
Move [[deprecated(...)]] before __attribute__ to fix C++14/C++17 uses
with Clang.

Fix #3250
2022-09-22 12:30:44 -07:00
Yann ColletandGitHub 43962d72e6 Merge pull request #3267 from Tachi107/pkg-config-ci
ci: test pkg-config file
2022-09-22 12:00:06 -07:00