<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Compression",
  "identifier" : "/documentation/Compression/COMPRESSION_LZBITMAP",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Compression"
    ],
    "preciseIdentifier" : "c:@EA@compression_algorithm@COMPRESSION_LZBITMAP"
  },
  "title" : "COMPRESSION_LZBITMAP"
}
-->

# COMPRESSION_LZBITMAP

The LZBITMAP compression algorithm, which is designed to exploit the vector instruction set of current CPUs.

```
var COMPRESSION_LZBITMAP: compression_algorithm { get }
```

## Discussion

LZBITMAP is the Apple compression algorithm designed around the SIMD vector instruction set found on modern CPUs. Its encoding scheme arranges literal and match data so that both encoder and decoder hot loops can advance multiple symbols per vector operation, which delivers substantially higher throughput than scalar LZ-family codecs at comparable compression ratios.

LZBITMAP sits between [`COMPRESSION_LZ4`](/documentation/Compression/COMPRESSION_LZ4) and [`COMPRESSION_LZMESH`](/documentation/Compression/COMPRESSION_LZMESH) in the speed-ratio tradeoff. It achieves compression ratios close to [`COMPRESSION_ZLIB`](/documentation/Compression/COMPRESSION_ZLIB) at a lower compression cost. When compression ratio and performance are equally important, prefer [`COMPRESSION_LZMESH`](/documentation/Compression/COMPRESSION_LZMESH) to favor ratio and LZBITMAP to favor decoder performance. If raw encoder speed matters more than ratio, use [`COMPRESSION_LZ4`](/documentation/Compression/COMPRESSION_LZ4) instead.

LZBITMAP is available only on Apple devices, so don’t use it for payloads that need to be decoded on non-Apple platforms. For cross-platform interoperability, use [`COMPRESSION_ZLIB`](/documentation/Compression/COMPRESSION_ZLIB) or [`COMPRESSION_LZ4`](/documentation/Compression/COMPRESSION_LZ4) instead.

LZBITMAP is available through the buffer API only — [`compression_encode_buffer(_:_:_:_:_:_:)`](/documentation/Compression/compression_encode_buffer(_:_:_:_:_:_:)) and [`compression_decode_buffer(_:_:_:_:_:_:)`](/documentation/Compression/compression_decode_buffer(_:_:_:_:_:_:)).

> Important:
> The Compression stream API doesn’t support the LZBITMAP compression algorithm. Use ``doc://com.apple.compression/documentation/Compression/COMPRESSION_LZFSE`` or ``doc://com.apple.compression/documentation/Compression/COMPRESSION_ZLIB`` if you need streaming behavior, such as compressing data as it arrives over the network or processing files larger than available memory.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)