Software:LZFSE
Developer(s) | Apple |
---|---|
Initial release | 2015 |
Stable release | lzfse-1.0
/ 8 May 2017 |
Repository | on GitHub |
Written in | C |
Operating system | macOS, iOS, Linux[1] |
Available in | C |
Type | Data compression |
License | 3-clause New BSD License |
LZFSE (Lempel–Ziv Finite State Entropy) is an open source lossless data compression algorithm created by Apple Inc. It was released with a simpler algorithm called LZVN.[2]
Overview
The name is an acronym for Lempel–Ziv and finite-state entropy[3] (implementation of asymmetric numeral systems). LZFSE was introduced by Apple at its Worldwide Developer Conference 2015. It shipped with that year's iOS 9 and OS X 10.11 releases.
Apple claims that LZFSE compresses with a ratio comparable to that of zlib (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.[3] Part of this energy efficiency was achieved by optimising the algorithm for modern micro-architectures, specifically focusing on arm64.[4] 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.[5]
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.[6] 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.[7]
Implementation
A reference C library written by Eric Bainville was made available under the 3-clause BSD License after WWDC 2016. It includes an executable to compress and decompress LZFSE streams as well. There are no plans to expose an LZVN API.[1]
Apple's LZFSE implementation uses a simpler algorithm called LZVN when the input is smaller than LZFSE_ENCODE_LZVN_THRESHOLD
(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.[7] 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 lzss
compression from Haruhiko Okumura.[8]
Usage
AppleFSCompression.framework (AFSC), the mechanism for quasi-transparent compression in HFS Plus and Apple File System, supports LZFSE and LZVN since OS X 10.9.
Apple's Disk Images framework has offered an LZFSE-based encoding called ULFO
since Mac OS X 10.11,[9] accessible via hdiutil(1)
[10] and some third-party image utilities.
Apple introduced the Apple Archive format and its associated API in macOS High Sierra in 2017.[11] The extension name is .aar (since macOS Big Sur, used to be .yaa). Encryption was introduced in macOS Monterey, when AA became the default Archive Utility format. Three command-line utilities are available in macOS to handle AA files.[12][13] Of third-party programs, Keka is able to use the system APIs to handle AA files, but no independent implementations exist on other systems.[14]
See also
- Zstandard – 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[15]
References
- ↑ 1.0 1.1 Bainville, Eric (2016-06-07). "LZFSE compression library and command line tool". GitHub. https://github.com/lzfse/lzfse. Retrieved 2016-07-04.
- ↑ Apple Inc.. "Data Compression - Compression | Apple Developer Documentation" (in en). https://developer.apple.com/documentation/compression.
- ↑ 3.0 3.1 De Simone, Sergio. "Apple Open-Sources its New Compression Algorithm LZFSE". https://www.infoq.com/news/2016/07/apple-lzfse-lossless-opensource. Retrieved 2016-07-07.
- ↑ Apple Inc. (2015-06-12). "Low Energy, High Performance: Compression and Accelerate – WWDC 2015 – Apple Developer Videos" (in en). https://developer.apple.com/videos/play/wwdc2015/712/. pdf
- ↑ "Compression Benchmark". https://sites.google.com/site/powturbo/home/benchmark. Retrieved 2018-08-10.
- ↑ "Squash Compression Benchmark". Squash. https://quixdb.github.io/squash-benchmark/. Retrieved 25 December 2019.
- ↑ 7.0 7.1 "lzfse_tunables.h". 18 December 2019. https://github.com/lzfse/lzfse/blob/master/src/lzfse_tunables.h. Retrieved 22 December 2019.
- ↑ Piker-Alpha (4 June 2014). "OS X 10.10 Yosemite DP1 kernel(cache)" (in en). https://pikeralpha.wordpress.com/2014/06/04/os-x-10-10-yosemite-dp1-kernelcache/. Retrieved 22 December 2019.
- ↑ Tsai, Michael (2015-10-07). "LZFSE Disk Images in El Capitan". https://mjtsai.com/blog/2015/10/07/lzfse-disk-images-in-el-capitan/.
- ↑ "hdiutil(1) mojave man page". https://www.unix.com/man-page/mojave/1/hdiutil/.
- ↑ "Apple Archive" (in en). https://developer.apple.com/documentation/applearchive?language=objc.
- ↑ "Inside Apple Archive: more than a compression format" (in en). 10 May 2022. https://eclecticlight.co/2022/05/10/inside-apple-archive-more-than-a-compression-format/.
- ↑ "AA(1): Manipulate Apple Archives". https://keith.github.io/xcode-man-pages/aa.1.html.
- ↑ "AppleArchive support · Issue #829 · aonez/Keka" (in en). https://github.com/aonez/Keka/issues/829.
- ↑ "compression_algorithm". Apple Inc.. https://developer.apple.com/documentation/compression/compression_algorithm.
External links
- on GitHub
- 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
Original source: https://en.wikipedia.org/wiki/LZFSE.
Read more |