• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

contrib/H03-May-2022-620423

doc/H03-May-2022-548383

examples/H03-May-2022-2,7561,933

lib/H03-May-2022-7,4954,729

programs/H03-May-2022-4,2833,034

tests/H03-May-2022-4,6013,560

visual/H03-May-2022-1,6581,621

.gitattributesH A D29-Nov-2018348 2217

.gitignoreH A D29-Nov-2018265 3226

.travis.ymlH A D29-Nov-20184.3 KiB151133

INSTALLH A D29-Nov-2018583 1612

LICENSEH A D29-Nov-2018565 129

MakefileH A D29-Nov-20186 KiB182105

NEWSH A D29-Nov-201810.6 KiB232200

README.mdH A D29-Nov-20184.9 KiB11587

appveyor.ymlH A D29-Nov-20185.7 KiB142135

circle.ymlH A D29-Nov-20182.1 KiB4038

README.md

1LZ4 - Extremely fast compression
2================================
3
4LZ4 is lossless compression algorithm,
5providing compression speed at 400 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 more speed up.
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 library is provided as open-source software using BSD 2-Clause license.
18
19
20|Branch      |Status   |
21|------------|---------|
22|master      | [![Build Status][travisMasterBadge]][travisLink] [![Build status][AppveyorMasterBadge]][AppveyorLink] [![coverity][coverBadge]][coverlink] |
23|dev         | [![Build Status][travisDevBadge]][travisLink]    [![Build status][AppveyorDevBadge]][AppveyorLink]                                         |
24
25[travisMasterBadge]: https://travis-ci.org/lz4/lz4.svg?branch=master "Continuous Integration test suite"
26[travisDevBadge]: https://travis-ci.org/lz4/lz4.svg?branch=dev "Continuous Integration test suite"
27[travisLink]: https://travis-ci.org/lz4/lz4
28[AppveyorMasterBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=master&svg=true "Windows test suite"
29[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=dev&svg=true "Windows test suite"
30[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/lz4-1lndh
31[coverBadge]: https://scan.coverity.com/projects/4735/badge.svg "Static code analysis of Master branch"
32[coverlink]: https://scan.coverity.com/projects/4735
33
34> **Branch Policy:**
35> - The "master" branch is considered stable, at all times.
36> - The "dev" branch is the one where all contributions must be merged
37    before being promoted to master.
38>   + If you plan to propose a patch, please commit into the "dev" branch,
39      or its own feature branch.
40      Direct commit to "master" are not permitted.
41
42Benchmarks
43-------------------------
44
45The benchmark uses [lzbench], from @inikep
46compiled with GCC v6.2.0 on Linux 64-bits.
47The reference system uses a Core i7-3930K CPU @ 4.5GHz.
48Benchmark evaluates the compression of reference [Silesia Corpus]
49in single-thread mode.
50
51[lzbench]: https://github.com/inikep/lzbench
52[Silesia Corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
53
54|  Compressor            | Ratio   | Compression | Decompression |
55|  ----------            | -----   | ----------- | ------------- |
56|  memcpy                |  1.000  | 7300 MB/s   |   7300 MB/s   |
57|**LZ4 fast 8  (v1.7.3)**|  1.799  |**911 MB/s** | **3360 MB/s** |
58|**LZ4 default (v1.7.3)**|**2.101**|**625 MB/s** | **3220 MB/s** |
59|  LZO 2.09              |  2.108  |  620 MB/s   |    845 MB/s   |
60|  QuickLZ 1.5.0         |  2.238  |  510 MB/s   |    600 MB/s   |
61|  Snappy 1.1.3          |  2.091  |  450 MB/s   |   1550 MB/s   |
62|  LZF v3.6              |  2.073  |  365 MB/s   |    820 MB/s   |
63|  [Zstandard] 1.1.1 -1  |  2.876  |  330 MB/s   |    930 MB/s   |
64|  [Zstandard] 1.1.1 -3  |  3.164  |  200 MB/s   |    810 MB/s   |
65| [zlib] deflate 1.2.8 -1|  2.730  |  100 MB/s   |    370 MB/s   |
66|**LZ4 HC -9 (v1.7.3)**  |**2.720**|   34 MB/s   | **3240 MB/s** |
67| [zlib] deflate 1.2.8 -6|  3.099  |   33 MB/s   |    390 MB/s   |
68
69[zlib]: http://www.zlib.net/
70[Zstandard]: http://www.zstd.net/
71
72LZ4 is also compatible and well optimized for x32 mode, for which it provides an additional +10% speed performance.
73
74
75Installation
76-------------------------
77
78```
79make
80make install     # this command may require root access
81```
82
83LZ4's `Makefile` supports standard [Makefile conventions],
84including [staged installs], [redirection], or [command redefinition].
85
86[Makefile conventions]: https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
87[staged installs]: https://www.gnu.org/prep/standards/html_node/DESTDIR.html
88[redirection]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
89[command redefinition]: https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html
90
91
92Documentation
93-------------------------
94
95The raw LZ4 block compression format is detailed within [lz4_Block_format].
96
97To compress an arbitrarily long file or data stream, multiple blocks are required.
98Organizing these blocks and providing a common header format to handle their content
99is the purpose of the Frame format, defined into [lz4_Frame_format].
100Interoperable versions of LZ4 must respect this frame format.
101
102[lz4_Block_format]: doc/lz4_Block_format.md
103[lz4_Frame_format]: doc/lz4_Frame_format.md
104
105
106Other source versions
107-------------------------
108
109Beyond the C reference source,
110many contributors have created versions of lz4 in multiple languages
111(Java, C#, Python, Perl, Ruby, etc.).
112A list of known source ports is maintained on the [LZ4 Homepage].
113
114[LZ4 Homepage]: http://www.lz4.org
115