README.OpenSource
1[
2 {
3 "Name": "lz4",
4 "License": "BSD 2-Clause License",
5 "License File": "LICENSE",
6 "Version Number": "1.9.2",
7 "Owner": "chennaidong@huawei.com",
8 "Upstream URL": "https://github.com/pierrec/lz4",
9 "Description": "This package provides a streaming interface to LZ4 data streams as well as low level compress and uncompress functions for LZ4 data blocks. The implementation is based on the reference C one."
10 }
11]
12
README.md
1LZ4 - Extremely fast compression
2================================
3
4LZ4 is lossless compression algorithm,
5providing compression speed > 500 MB/s per core,
6scalable with multi-cores CPU.
7It features an extremely fast decoder,
8with speed in multiple GB/s per core,
9typically reaching RAM speed limits on multi-core systems.
10
11Speed can be tuned dynamically, selecting an "acceleration" factor
12which trades compression ratio for faster speed.
13On the other end, a high compression derivative, LZ4_HC, is also provided,
14trading CPU time for improved compression ratio.
15All versions feature the same decompression speed.
16
17LZ4 is also compatible with [dictionary compression](https://github.com/facebook/zstd#the-case-for-small-data-compression),
18both at [API](https://github.com/lz4/lz4/blob/v1.8.3/lib/lz4frame.h#L481) and [CLI](https://github.com/lz4/lz4/blob/v1.8.3/programs/lz4.1.md#operation-modifiers) levels.
19It can ingest any input file as dictionary, though only the final 64KB are used.
20This capability can be combined with the [Zstandard Dictionary Builder](https://github.com/facebook/zstd/blob/v1.3.5/programs/zstd.1.md#dictionary-builder),
21in order to drastically improve compression performance on small files.
22
23
24LZ4 library is provided as open-source software using BSD 2-Clause license.
25
26
27|Branch |Status |
28|------------|---------|
29|master | [![Build Status][travisMasterBadge]][travisLink] [![Build status][AppveyorMasterBadge]][AppveyorLink] [![coverity][coverBadge]][coverlink] |
30|dev | [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] |
31
32[travisMasterBadge]: https://travis-ci.org/lz4/lz4.svg?branch=master "Continuous Integration test suite"
33[travisDevBadge]: https://travis-ci.org/lz4/lz4.svg?branch=dev "Continuous Integration test suite"
34[travisLink]: https://travis-ci.org/lz4/lz4
35[AppveyorMasterBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=master&svg=true "Windows test suite"
36[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=dev&svg=true "Windows test suite"
37[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/lz4-1lndh
38[coverBadge]: https://scan.coverity.com/projects/4735/badge.svg "Static code analysis of Master branch"
39[coverlink]: https://scan.coverity.com/projects/4735
40
41> **Branch Policy:**
42> - The "master" branch is considered stable, at all times.
43> - The "dev" branch is the one where all contributions must be merged
44 before being promoted to master.
45> + If you plan to propose a patch, please commit into the "dev" branch,
46 or its own feature branch.
47 Direct commit to "master" are not permitted.
48
49Benchmarks
50-------------------------
51
52The benchmark uses [lzbench], from @inikep
53compiled with GCC v8.2.0 on Linux 64-bits (Ubuntu 4.18.0-17).
54The reference system uses a Core i7-9700K CPU @ 4.9GHz (w/ turbo boost).
55Benchmark evaluates the compression of reference [Silesia Corpus]
56in single-thread mode.
57
58[lzbench]: https://github.com/inikep/lzbench
59[Silesia Corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
60
61| Compressor | Ratio | Compression | Decompression |
62| ---------- | ----- | ----------- | ------------- |
63| memcpy | 1.000 | 13700 MB/s | 13700 MB/s |
64|**LZ4 default (v1.9.0)** |**2.101**| **780 MB/s**| **4970 MB/s** |
65| LZO 2.09 | 2.108 | 670 MB/s | 860 MB/s |
66| QuickLZ 1.5.0 | 2.238 | 575 MB/s | 780 MB/s |
67| Snappy 1.1.4 | 2.091 | 565 MB/s | 1950 MB/s |
68| [Zstandard] 1.4.0 -1 | 2.883 | 515 MB/s | 1380 MB/s |
69| LZF v3.6 | 2.073 | 415 MB/s | 910 MB/s |
70| [zlib] deflate 1.2.11 -1| 2.730 | 100 MB/s | 415 MB/s |
71|**LZ4 HC -9 (v1.9.0)** |**2.721**| 41 MB/s | **4900 MB/s** |
72| [zlib] deflate 1.2.11 -6| 3.099 | 36 MB/s | 445 MB/s |
73
74[zlib]: http://www.zlib.net/
75[Zstandard]: http://www.zstd.net/
76
77LZ4 is also compatible and optimized for x32 mode,
78for which it provides additional speed performance.
79
80
81Installation
82-------------------------
83
84```
85make
86make install # this command may require root permissions
87```
88
89LZ4's `Makefile` supports standard [Makefile conventions],
90including [staged installs], [redirection], or [command redefinition].
91It is compatible with parallel builds (`-j#`).
92
93[Makefile conventions]: https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
94[staged installs]: https://www.gnu.org/prep/standards/html_node/DESTDIR.html
95[redirection]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
96[command redefinition]: https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html
97
98
99Documentation
100-------------------------
101
102The raw LZ4 block compression format is detailed within [lz4_Block_format].
103
104Arbitrarily long files or data streams are compressed using multiple blocks,
105for streaming requirements. These blocks are organized into a frame,
106defined into [lz4_Frame_format].
107Interoperable versions of LZ4 must also respect the frame format.
108
109[lz4_Block_format]: doc/lz4_Block_format.md
110[lz4_Frame_format]: doc/lz4_Frame_format.md
111
112
113Other source versions
114-------------------------
115
116Beyond the C reference source,
117many contributors have created versions of lz4 in multiple languages
118(Java, C#, Python, Perl, Ruby, etc.).
119A list of known source ports is maintained on the [LZ4 Homepage].
120
121[LZ4 Homepage]: http://www.lz4.org
122