- fat-lto for fat lto, will override thin-lto if specified
- thin-lto for thin lto, will fallback to fat-lto is not supported
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Take `Option<usize>` for `set_pledged_size` rather than rely on caller
using `CONTENTSIZE_UNKNOWN`.
* Return `Option<NonZeroU64>` for `get_decompressed_size`.
* Replace `u32` with `Option<NonZeroU32>` for dictionary IDs
* Replace redundant functions that were just forwarding calls to
`CCtx`/`DCtx`/...
* Added documentation for all items
* Fixed some functions not returning a `Result` when they should have.
* Add `disable_dictionary` to `CCtx` and `DCtx`.
* `DCtx::reset()` now takes a reset directive, just like `CCtx::reset`
* Removed deprecated `CCtx::reset_cstream`.
* Added support of "thin" feature to reduce library size using recommendations from zstd/lib.
* Reverted error strings.
* Fixed build with GCC.
* Fixed comment.
Co-authored-by: Denis K <@tonlabs.io>
ZSTD sometimes doesn't output very helpful information by default. This adds a feature to enable debug logging from zstd.
before:
```
training dict of size 1503kB with 196608 samples of total size 150338kB (of 196608 samples seen)
Error: Training dictionary failed
Caused by:
Error (generic)
```
what is happen??!!
after with features = ["debug"]:
```
[2020-12-20T16:16:04Z DEBUG sqlite_zstd::dict_training] training dict of size 1503kB with 196608 samples of total size 150338kB (of 196608 samples seen)
zstd/lib/dictBuilder/zdict.c: ZDICT_trainFromBuffer
Trying 5 different sets of parameters
d=8
Training on 147456 samples of total size 100940410
Testing on 49152 samples of total size 49397760
Computing frequencies
k=50
Breaking content into 30067 epochs of size 3357
zstd/lib/dictBuilder/zdict.c: ZDICT_finalizeDictionary
Failed to select dictionary
20% k=537
Breaking content into 2799 epochs of size 36063
zstd/lib/dictBuilder/zdict.c: ZDICT_finalizeDictionary
Failed to select dictionary
40% k=1024
Breaking content into 1468 epochs of size 68760
zstd/lib/dictBuilder/zdict.c: ZDICT_finalizeDictionary
Failed to select dictionary
60% k=1511
Breaking content into 994 epochs of size 101549
zstd/lib/dictBuilder/zdict.c: ZDICT_finalizeDictionary
Failed to select dictionary
80% k=1998
Breaking content into 752 epochs of size 134229
zstd/lib/dictBuilder/zdict.c: ZDICT_finalizeDictionary
Failed to select dictionary
Error: Training dictionary failed
Caused by:
Error (generic)
```