53 Commits
Author SHA1 Message Date
ddidderr 54f5c29742 feat(rust): port program timing helpers
Move the implementation of programs/timefn.c into rust/src/timefn.rs. The
file provides the monotonic nanosecond clock (UTIL_getTime, span helpers,
UTIL_waitForNextTick, UTIL_support_MT_measurements) used by the CLI and by
several C test tools. timefn.c remains as a declaration-only shim so the
original source lists and header configuration keep working, and it pins the
ABI with static asserts: UTIL_time_t is returned by value and must stay a
plain 64-bit counter, which the Rust #[repr(C)] mirror also asserts.

Platform selection mirrors the C preprocessor structure: Windows uses
QueryPerformanceCounter, Apple targets use mach_absolute_time, and other
POSIX systems use libc clock_gettime(CLOCK_MONOTONIC). Only the unix path is
exercised by this environment; the Windows and Apple paths are written from
the C source and compile-checked logically but are untested here. The C90
clock() fallback is unreachable on Rust-supported targets, so multi-threaded
measurement support is always reported.

The symbols live in the program-only zstd-cli-rs package, keeping them out
of library builds. Linking that archive into C test binaries surfaced a
structural problem: rustc's local ThinLTO promotes internal symbols across
codegen units, so extracting the timefn object could drag in the zstd_cli
parser object, whose FIO_* externs test binaries cannot satisfy. The parser
is therefore gated behind a new additive `cli` cargo feature (default on).
Program archives build with cli,compression,decompression as before, while
tests/Makefile links a helpers-only archive (rust/target/cli-helpers) built
with --no-default-features, which contains no fileio references at all.

tests/Makefile gains build rules for the helpers archive and adds it as a
prerequisite of every binary that compiles the timefn shim: fullbench(32),
fullbench-lib, fullbench-dll, fuzzer(32), zstreamtest(32/asan/tsan/ubsan),
paramgrill, decodecorpus, and poolTests. Prerequisite order places the
archive after all C objects in `$^` link lines; the known-broken -dll
recipes filter to %.c, so they name the archive explicitly. Original C test
sources are untouched; only link inputs changed.

zstd-cli-rs now depends on libc (already used by the core crate) for
clock_gettime and the Mach timebase bindings.

Test Plan:
- cd rust && cargo fmt --check && cargo clippy --all-targets -- -D warnings
  && cargo test --all-targets && cargo build --release
- cd rust/cli && cargo fmt --check && cargo clippy --all-targets -- -D
  warnings && cargo test --all-targets; repeat tests with
  --no-default-features plus features compression / decompression / (none)
- make -C programs zstd; roundtrip echo hello | zstd | zstd -d
- make -C tests fullbench fuzzer zstreamtest paramgrill decodecorpus
  poolTests; ./tests/fullbench -i0; ./tests/fuzzer -i1 --no-big-tests;
  ./tests/poolTests; make -C tests test-rust-lib-smoke
- verified with nm that the helpers archive member defining UTIL_getTime has
  no FIO_*/ZSTD_* undefined references

Refs: rust/README.md
2026-07-11 14:25:32 +02:00
ddidderr 57106c5c32 chore(rust): ignore Cargo target artifacts
Keep local Rust build outputs out of the migration diff. The static archive is
rebuilt by the validation workflow and must not be tracked as source.

Test Plan:
- git check-ignore -v rust/target

Refs: rust/README.md
2026-07-10 20:07:17 +02:00
Treata11 03d5ad6fed Ignore generated framework artifacts
Signed-off-by: Treata11 <treata11@yahoo.com>
2025-01-21 21:06:54 +03:30
Yann Collet 1e046ce7fa increase vocabulary size
makes compression a bit less good,
hence a bit more comparable with real text (though still too easy to compress).
level 6 is now stronger than level 4, by a hair.
However, there is still a ratio dip at level 5.
2024-02-20 00:12:32 -08:00
Yann Collet 2fc7248412 fix cmakebuild test
write it in a way which is more compatible with older versions of cmake (<3.13)

Also:
fix pzstd compilation (notably on macos)
2024-01-27 17:30:06 -08:00
Yann Collet e4aeaebc20 fixed incorrect test in Win32 pthread wrapper
reported by @Banzai24-yht in #3683
2023-06-20 08:34:26 -07:00
Alexander Lobakin d8b7fc51c8 [contrib][linux] Add contrib/linux-kernel/linux to .gitignore
The mentioned path is being created/used by the 'import' rule for
generating source files for Linux kernel.

Signed-off-by: Alexander Lobakin <alobakin@pm.me>
2021-09-23 16:39:39 +02:00
Nick TerrellandSen Huang 4694423c4f Add and integrate lazy row hash strategy 2021-04-07 09:53:34 -07:00
senhuang42 6b6cc80196 Support .zstd suffix only for decompression 2020-09-18 12:49:51 -04:00
Martin Liska 7276ab15bc Add GCC PGO data files to .gitignore. 2020-07-09 09:32:54 +02:00
Yann Collet 11a392ce23 minor markdown formatting fix 2020-05-26 13:15:35 -07:00
Yann Collet 3746693b71 added ppc64le tests on travis
on real hardware
2019-12-15 01:30:12 -08:00
Nick Terrell e68db76b4b Update .gitignore 2019-11-20 16:36:40 -08:00
Yann Collet e0fb7e1eaf ignore dictionary artifacts 2019-09-12 09:39:15 -07:00
Yann Collet e8a7f5d3ce double-fast: changed the trade-off for a smaller positive change
same number of complementary insertions, just organized differently
(long at `ip-2`, short at `ip-1`).
2019-07-12 11:34:53 -07:00
Yann Collet 2387d574cb updated .gitignore 2019-07-09 14:54:48 -07:00
LeeYoung624 654cb9d439 fix gitignore errors 2019-07-09 21:08:13 +08:00
Tyler-TranandNick Terrell cb47871a0a [dictBuilder] Be more specific than ERROR(generic) (#1616)
* Specify errors at a finer granularity than `ERROR(generic)`.
* Add tests for bad parameters in the dictionary builder.
2019-05-22 18:57:50 -07:00
cyan4973 b095bffac6 ignore Windows build/test artefacts 2018-05-01 05:45:46 -07:00
Yann Collet 35fc66f257 updated .gitignore for new cmake script 2017-03-21 17:52:42 -07:00
Nick Terrell 9c018cc140 Add BUCK files for Nuclide support 2017-01-27 10:43:12 -08:00
Yann Collet 900f39e709 skip zstdmt at root directory 2017-01-20 16:36:29 -08:00
Przemyslaw Skibinski cc3887085f updated build\README.md 2016-11-21 13:58:58 +01:00
Przemyslaw Skibinski 2558b4cdbc bench.c without dict uses ZSTD_compressCCtx 2016-11-18 11:46:30 +01:00
Nick Terrell 8b4e84249b [pzstd] Fix Makefile 2016-10-14 15:26:50 -07:00
inikep 447e5128da updated .gitignore 2016-09-28 13:23:11 +02:00
Yann ColletandGitHub be38198ef0 Merge pull request #325 from terrelln/dev
Add Parallel Zstandard tool to contrib/
2016-09-01 17:12:09 -07:00
Nick Terrell 040cfd8e7d Get ready to add tests to travis-ci 2016-09-01 16:21:19 -07:00
Yann Collet b2490e975a changed test to avoid issue #316 (reported by John the Scott) 2016-09-01 15:46:09 -07:00
Yann Collet 1095e01213 ignore Mac-related artefact 2016-08-17 15:48:18 +02:00
inikep cfe5fe4581 modified .gitignore 2016-08-10 14:34:13 +02:00
Yann Collet dd25a27702 added tutorial warning messages for dictBuilder 2016-07-27 12:43:09 +02:00
Yann Collet ae68f8ddb3 minor 2016-07-22 14:37:09 +02:00
Yann Collet 2cac5b30b9 changed default compression level to 3 (can be modified with macro ZSTDCLI_DEFAULT_CLEVEL) 2016-07-13 14:15:08 +02:00
Yann Collet 19cab46f2f Joined seqStore initialization at dispatch point 2016-06-17 12:54:52 +02:00
Christophe Chevalier dea76e1db0 Added build commands for various versions of Visual Studio
- For people who want to build the library without opening it in VS
2016-06-07 11:36:13 +02:00
inikep 5c2771710d Merge remote-tracking branch 'refs/remotes/Cyan4973/dev070' into dev070
# Conflicts:
#	.gitignore
#	lib/decompress/zstd_decompress.c
#	programs/zbufftest.c
2016-06-01 09:16:11 +02:00
Yann Collet f2a3b6e7b4 added : frame content checksum 2016-05-31 22:23:45 +02:00
inikep 5bee32e349 cmake project works with MSYS 2016-05-31 13:36:14 +02:00
inikep 0ba773878f updated .gitignore for Visual Studio 2016-05-16 14:54:48 +02:00
inikep 6e61a842b8 added support for VS 2015 2016-05-09 14:00:54 +02:00
inikep d6be2751a8 updated CMakeLists.txt 2016-04-22 13:59:21 +02:00
inikep c5e1d295ee bench.c: force at least one compression and decompression loop
fix for -i0 with small files
2016-04-19 09:37:59 +02:00
inikep d700a1a8b9 ZSTD_setAdditionalParam 2016-03-15 12:18:44 +01:00
Christophe Chevalier c8fde3be45 Added new ".VC.db" Visual Studio C++ database file to gitignore 2016-02-23 12:09:50 +01:00
inikep baff8d6c1f gitignore 2016-02-04 16:02:05 +01:00
inikep e1b8e53e84 better logging 2016-02-02 15:41:16 +01:00
inikep c71568fd44 ZSTD_opt 2016-01-31 11:26:04 +01:00
Artem Dymchenko 8ce6be37a0 EOF added; 2016-01-10 12:30:16 +06:00
Artyom Dymchenko 8665cdb213 CMake structure reorganized;
install and uninstall targets added;
2016-01-10 17:20:52 +06:00