java lz4 压缩_LZ4是一个极快的压缩算法

LZ4是一种无损压缩算法,提供超过500 MB/s的单核压缩速度,并且随着多核CPU的增加而扩展。其解压速度非常快,通常达到多核系统的RAM速度限制。LZ4还支持字典压缩,可以与Zstandard字典构建器结合使用,以提高小文件的压缩性能。此外,提供了调整速度的加速因子和更高的压缩比选项LZ4_HC。该库以BSD 2-Clause许可证开源。
摘要由CSDN通过智能技术生成

LZ4 - Extremely fast compression

LZ4 is lossless compression algorithm, providing compression speed > 500 MB/s per core, scalable with multi-cores CPU. It features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems.

Speed can be tuned dynamically, selecting an "acceleration" factor which trades compression ratio for faster speed. On the other end, a high compression derivative, LZ4_HC, is also provided, trading CPU time for improved compression ratio. All versions feature the same decompression speed.

LZ4 is also compatible with dictionary compression, both at API and CLI levels. It can ingest any input file as dictionary, though only the final 64KB are used. This capability can be combined with the Zstandard Dictionary Builder, in order to drastically improve compression performance on small files.

LZ4 library is provided as open-source software using BSD 2-Clause license.

Branch

Status

master

68747470733a2f2f7472617669732d63692e6f72672f6c7a342f6c7a342e7376673f6272616e63683d6d617374657268747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f6769746875622f6c7a342f6c7a343f6272616e63683d6d6173746572267376673d7472756568747470733a2f2f7363616e2e636f7665726974792e636f6d2f70726f6a656374732f343733352f62616467652e737667

dev

68747470733a2f2f7472617669732d63692e6f72672f6c7a342f6c7a342e7376673f6272616e63683d64657668747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f6769746875622f6c7a342f6c7a343f6272616e63683d646576267376673d74727565

Branch Policy:

The "master" branch is considered stable, at all times.

The "dev" branch is the one where all contributions must be merged before being promoted to master.

If you plan to propose a patch, please commit into the "dev" branch, or its own feature branch. Direct commit to "master" are not permitted.

Benchmarks

The benchmark uses lzbench, from @inikep compiled with GCC v8.2.0 on Linux 64-bits (Ubuntu 4.18.0-17). The reference system uses a Core i7-9700K CPU @ 4.9GHz (w/ turbo boost). Benchmark evaluates the compression of reference Silesia Corpus in single-thread mode.

Compressor

Ratio

Compression

Decompression

memcpy

1.000

13700 MB/s

13700 MB/s

LZ4 default (v1.9.0)

2.101

780 MB/s

4970 MB/s

LZO 2.09

2.108

670 MB/s

860 MB/s

QuickLZ 1.5.0

2.238

575 MB/s

780 MB/s

Snappy 1.1.4

2.091

565 MB/s

1950 MB/s

2.883

515 MB/s

1380 MB/s

LZF v3.6

2.073

415 MB/s

910 MB/s

zlib deflate 1.2.11 -1

2.730

100 MB/s

415 MB/s

LZ4 HC -9 (v1.9.0)

2.721

41 MB/s

4900 MB/s

zlib deflate 1.2.11 -6

3.099

36 MB/s

445 MB/s

LZ4 is also compatible and optimized for x32 mode, for which it provides additional speed performance.

Installation

make

make install # this command may require root permissions

LZ4's Makefile supports standard Makefile conventions, including staged installs, redirection, or command redefinition. It is compatible with parallel builds (-j#).

Building LZ4 - Using vcpkg

You can download and install LZ4 using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git

cd vcpkg

./bootstrap-vcpkg.sh

./vcpkg integrate install

vcpkg install lz4

The LZ4 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Documentation

The raw LZ4 block compression format is detailed within lz4_Block_format.

Arbitrarily long files or data streams are compressed using multiple blocks, for streaming requirements. These blocks are organized into a frame, defined into lz4_Frame_format. Interoperable versions of LZ4 must also respect the frame format.

Other source versions

Beyond the C reference source, many contributors have created versions of lz4 in multiple languages (Java, C#, Python, Perl, Ruby, etc.). A list of known source ports is maintained on the LZ4 Homepage.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值