InfoQ Homepage News Apple Open-Sources its New Compression Algorithm LZFSE
Apple Open-Sources its New Compression Algorithm LZFSE
Leia em Português
This item in japanese
Jul 02, 2016 1 min read
Write for InfoQ
Feed your curiosity. Help 550k+ globalsenior developers
each month stay ahead.Get in touch
Apple has open-sourced its new lossless compression algorithm, LZFSE, introduced last year with iOS 9 and OS X 10.10. According to Apple, LZFE provides the same compression gain as ZLib level 5 while being 2x–3x faster and with higher energy efficiency.
LZFSE is based on Lempel-Ziv and uses Finite State Entropy coding, based on Jarek Duda’s work on Asymmetric Numeral Systems (ANS) for entropy coding. Shortly, ANS aims to “end the trade-off between speed and rate” and can be used both for precise coding and very fast encoding, with support for data encryption. LZFSE is one of a growing number of compression libraries that use ANS in place of the more traditional Huffman and arithmetic coding.
Admittedly, LZFSE does not aim to be the best or fastest algorithm out there. In fact, Apple states that LZ4 is faster than LZFSE while LZMA provides a higher compression ratio, albeit at the cost of being an order of magnitude slower than other options available in Apple SDKs. LZFSE is Apple’s suggested option when compression and speed are more or less equally important and you want reduce energy consumption.
LZFSE reference implementation is available on GitHub. Building on macOS is as easy as executing:
$ xcodebuild install DSTROOT=/tmp/lzfse.dst
If you want to build LZFSE for a current iOS device, you can execute:
xcodebuild -configuration "Release" -arch armv7 install DSTROOT=/tmp/lzfse.dst
Besides its API documentation, a useful resource to start using LZFSE is a sample project that Apple made available last year to show how to use LZFSE both for block and stream compression.
LZFSE follows on Google’s brotli, which was open sourced last year. In comparison to LZFSE, brotli seems to be tuned for a different use case, such as compressing static Web assets and Android APKs, where compression rates are of prime importance.
This content is in the MacOS topic
Related Topics:
-
Related Editorial
-
Related Sponsors
-
Popular across InfoQ
-
ArrowJS Reaches 1.0, Recast as the First UI Framework for the Agentic Era
-
Anthropic Releases and Temporarily Suspends Claude Fable 5
-
Slack Eliminates SSH in EMR Pipelines, Migrates 700+ Jobs to Rest-Based Architecture
-
Anthropic Explains How Claude Builds Its Own Execution Harnesses
-
Spring Boot 4.1 Adds gRPC Auto-Configuration, SSRF Mitigation, and Kotlin 2.3 Support
-
Increasing Users' Data Agency: From BlueSky's AT Protocol to the Local-First Software Movement
-
The InfoQ Newsletter
A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example
