zstd/lib
Nick Terrell 10bfd0c0d5 Fix ZSTD_execSequence() performance regression
Commit ae1cb3b3d0 caused the regression.
It is an instruction alignment issue, because if it is `U64 i` instead
of `U32 i`, the regression returns.  This patch fixes the regression
in gcc, but only gets some of the clang performance back.

Benchmarks:
Run on `silesia.tar`.  I only show levels 1-5 because the performance
regression was uniform across all levels.  I did one run on levels
1-19 and it looked good.

| Build | Level | Before | While | After |
|-------|-------|-------:|------:|------:|
| gcc   |     1 |  931.4 | 904.4 | 932.8 |
| gcc   |     2 |  849.1 | 822.6 | 851.2 |
| gcc   |     3 |  815.6 | 790.6 | 818.9 |
| gcc   |     4 |  794.1 | 770.7 | 798.0 |
| gcc   |     5 |  785.7 | 760.7 | 788.8 |
| clang |     1 |  705.5 | 683.2 | 693.8 |
| clang |     2 |  670.0 | 649.2 | 660.7 |
| clang |     3 |  659.6 | 639.8 | 651.4 |
| clang |     4 |  652.5 | 634.7 | 645.9 |
| clang |     5 |  646.9 | 625.5 | 637.7 |
2016-10-27 16:19:57 -07:00
..
common Fix stack buffer overrun when weightTotal == 0 2016-10-19 11:39:11 -07:00
compress ZSTD_initCStream() optimization : do not allocate a CDict when no dictionary used 2016-10-27 14:20:55 -07:00
decompress Fix ZSTD_execSequence() performance regression 2016-10-27 16:19:57 -07:00
dictBuilder improved dicitonary segment merge 2016-10-18 16:34:58 -07:00
legacy Merge remote-tracking branch 'upstream/dev' into fixes 2016-10-24 13:10:13 -07:00
.gitignore Added "dictionary decompression" example 2016-07-07 14:08:00 +02:00
Makefile make creates libzstd binaries (#415) 2016-10-12 11:09:36 -07:00
README.md updated README.md 2016-08-29 13:04:26 +02:00
libzstd.pc.in fixed a few links 2016-09-02 22:11:49 -07:00
zstd.h ZSTD_initCStream() optimization : do not allocate a CDict when no dictionary used 2016-10-27 14:20:55 -07:00

README.md

Zstandard library files

The lib directory contains several directories. Depending on target use case, it's enough to include only files from relevant directories.

API

Zstandard's stable API is exposed within zstd.h, at the root of lib directory.

Advanced API

Some additional API may be useful if you're looking into advanced features :

  • common/error_public.h : transforms size_t function results into an enum, for precise error handling.
  • ZSTD_STATIC_LINKING_ONLY : if you define this macro before including zstd.h, it will give access to advanced and experimental API. These APIs shall never be used with dynamic library ! They are not "stable", their definition may change in the future. Only static linking is allowed.

Modular build

Directory common/ is required in all circumstances. You can select to support compression only, by just adding files from the compress/ directory, In a similar way, you can build a decompressor-only library with the decompress/ directory.

Other optional functionalities provided are :

  • dictBuilder/ : source files to create dictionaries. The API can be consulted in dictBuilder/zdict.h. This module also depends on common/ and compress/ .

  • legacy/ : source code to decompress previous versions of zstd, starting from v0.1. This module also depends on common/ and decompress/ . Library compilation must include directive ZSTD_LEGACY_SUPPORT = 1 . The main API can be consulted in legacy/zstd_legacy.h. Advanced API from each version can be found in their relevant header file. For example, advanced API for version v0.4 is in legacy/zstd_v04.h .

Obsolete streaming API

Streaming is now provided within zstd.h. Older streaming API is still provided within common/zbuff.h. It is considered obsolete, and will be removed in a future version. Consider migrating towards newer streaming API.

Miscellaneous

The other files are not source code. There are :

  • LICENSE : contains the BSD license text
  • Makefile : script to compile or install zstd library (static and dynamic)
  • libzstd.pc.in : for pkg-config (make install)
  • README.md : this file