LZFSE
   HOME

TheInfoList



OR:

LZFSE (Lempel–Ziv Finite State Entropy) is an
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
lossless data compression Lossless compression is a class of data compression that allows the original data to be perfectly reconstructed from the compressed data with no loss of information. Lossless compression is possible because most real-world data exhibits Redundanc ...
algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
created by
Apple Inc. Apple Inc. is an American multinational corporation and technology company headquartered in Cupertino, California, in Silicon Valley. It is best known for its consumer electronics, software, and services. Founded in 1976 as Apple Comput ...
It was released with a simpler algorithm called LZVN.


Overview

The name is an acronym for Lempel–Ziv and finite-state entropy (implementation of
asymmetric numeral systems Asymmetric numeral systems (ANS)J. Duda, K. Tahboub, N. J. Gadil, E. J. Delp''The use of asymmetric numeral systems as an accurate replacement for Huffman coding'' Picture Coding Symposium, 2015.J. Duda''Asymmetric numeral systems: entropy coding ...
). LZFSE was introduced by Apple at its Worldwide Developer Conference 2015. It shipped with that year's
iOS 9 iOS 9 is the ninth major release of the iOS mobile operating system developed by Apple Inc., being the successor to iOS 8. It was announced at the company's Worldwide Developers Conference on June 8, 2015, and was released on September 16, ...
and OS X 10.11 releases. Apple claims that LZFSE compresses with a ratio comparable to that of
zlib zlib ( or "zeta-lib", ) is a software library used for data compression as well as a data format. zlib was written by Jean-loup Gailly and Mark Adler and is an abstraction of the DEFLATE compression algorithm used in their gzip file compre ...
( DEFLATE) and decompresses two to three times faster while using fewer resources, therefore offering higher energy efficiency than zlib. It was aimed for scenarios where decompression speed and rate should be prioritised equally. Part of this energy efficiency was achieved by optimising the algorithm for modern micro-architectures, specifically focusing on
arm64 AArch64, also known as ARM64, is a 64-bit version of the ARM architecture family, a widely used set of computer processor designs. It was introduced in 2011 with the ARMv8 architecture and later became part of the ARMv9 series. AArch64 allows ...
. Third-party benchmarking confirms that LZFSE decompresses faster than zlib, but also suggests that many other modern compression algorithms may have more favorable compression algorithm performance characteristics such as density, compression speed and decompression speed by a significant margin. According to the Squash Benchmark, LZFSE is similar in speed to zstd (level 6), but has a slightly worse ratio. LZVN is similar in speed to LZ4 level 4, with a slightly worse ratio as well. Neither LZFSE nor LZVN is tunable at runtime, although a few constants can be tweaked at compile time for the usual speed-ratio trade-off.


Implementation

A reference C
library A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
written by Eric Bainville was made available under the 3-clause BSD License after
WWDC The Worldwide Developers Conference (WWDC) is an information technology conference held annually by Apple Inc. The conference is currently held at Apple Park in California. The event is used to showcase new software and technologies in the macO ...
2016. It includes an executable to compress and decompress LZFSE streams as well. There are no plans to expose an LZVN API. Apple's LZFSE implementation uses a simpler algorithm called LZVN when the input is smaller than (4096 bytes). This is a LZSS-type algorithm without entropy encoding but with three widths of REP (L,M,D) packets. In the open source reference implementation, Apple explains that LZFSE does not perform as well for small sizes, so LZVN is used instead. This algorithm in libfastCompression.a was discovered earlier as the default kernelcache compression method in Mac OS X Yosemite Developer Preview 1 (2014), replacing the legacy compression from Haruhiko Okumura.


Usage

AppleFSCompression.framework (AFSC), the mechanism for quasi-transparent compression in
HFS Plus HFS Plus or HFS+ (also known as Mac OS Extended or HFS Extended) is a journaling file system developed by Apple Inc. It replaced the Hierarchical File System (HFS) as the primary file system of Apple computers with the 1998 release of Mac OS 8. ...
and
Apple File System Apple File System (APFS) is a Proprietary software, proprietary file system developed and deployed by Apple Inc. for macOS macOS Sierra, Sierra (10.12.4) and later, iOS iOS 10 , 10.3, tvOS 10.2, watchOS 3.2, and all versions of iPadOS. It aim ...
, supports LZFSE and LZVN since OS X 10.9. Apple's Disk Images framework has offered an LZFSE-based encoding called since Mac OS X 10.11, accessible via and some third-party image utilities. Apple introduced the Apple Archive format and its associated API in macOS High Sierra in 2017. The extension name is ''.aar'' (since
macOS Big Sur macOS Big Sur (version 11) is the seventeenth software versioning, major release of macOS, Apple Inc., Apple's operating system for Macintosh computers. It was announced at Apple's Worldwide Developers Conference (WWDC) on June 22, 2020, and w ...
, used to be ''.yaa''). Encryption was introduced in
macOS Monterey macOS Monterey (version 12) is the eighteenth major release of macOS, Apple's desktop operating system for Macintosh computers. The successor to macOS Big Sur, it was announced at WWDC 2021 on June 7, 2021, and released on October 25, 2021. ...
, when AA became the default Archive Utility format. Three command-line utilities are available in macOS to handle AA files. Of third-party programs, Keka is able to use the system APIs to handle AA files, but no independent implementations exist on other systems.


See also

*
Zstandard Zstandard is a lossless compression, lossless data compression algorithm developed by Yann Collet at Facebook. Zstd is the corresponding reference implementation in C (programming language), C, released as open-source software on 31 August 201 ...
– another combination of LZ77 and FSE, by Yann Collet, the FSE author * LZ4 compression algorithm – a fast member of the LZ77 family, also available on Apple platforms


References


External links

*
Finite State Entropy by Yann Collet (Cyan4973)
the source of the FSE implementation in LZFSE
Discussion on Encode.su
from which the maintainer Eric Bainville has taken suggestions {{Compression Methods Lossless compression algorithms Free computer libraries Data compression