---
title: COMPRESSION_LZRAVEN
framework: compression
role: symbol
role_heading: Global Variable
path: compression/compression_lzraven
---

# COMPRESSION_LZRAVEN

The LZRAVEN compression algorithm, which is recommended for high-compression ratio with fast decoding on Apple platforms.

## Declaration

```swift
var COMPRESSION_LZRAVEN: compression_algorithm { get }
```

## Discussion

Discussion LZRAVEN is the Apple high-compression algorithm, designed to replace COMPRESSION_LZMA across Apple platforms. It combines LZ77 with modern entropy coding, adaptive context-sensitive modeling, and near-optimal parsing to often achieve a slightly better compression ratio than COMPRESSION_LZMA. LZRAVEN uses an 8 MB dictionary and encodes faster than COMPRESSION_LZMA while decoding 3x faster on Apple silicon, where the decoder leverages vector units to process multiple symbols per operation. An LZRAVEN-encoded buffer begins with a stream header that encodes global encoder parameters, defines the quantized size of the LZ dictionary, and provides reserved feature flags for future extensions. The stream header is followed by a sequence of compressed or uncompressed blocks that are terminated by an empty block. Each block begins with a header that encodes the block’s compressed size and feature flags. A block can be either compressed or stored uncompressed when compression would provide no benefit. LZRAVEN is practical for latency-sensitive workloads where COMPRESSION_LZMA decode speed would be prohibitive. LZRAVEN is available through the buffer API only — compression_encode_buffer(_:_:_:_:_:_:) and compression_decode_buffer(_:_:_:_:_:_:). The decoder requires approximately 36 KB of scratch memory, making it well suited for memory-constrained environments. note: The COMPRESSION_LZRAVEN algorithm is available in version 27 or later of Apple operating systems.

## See Also

### Algorithm Constants

- [COMPRESSION_LZFSE](compression/compression_lzfse.md)
- [COMPRESSION_LZ4](compression/compression_lz4.md)
- [COMPRESSION_LZ4_RAW](compression/compression_lz4_raw.md)
- [COMPRESSION_LZMA](compression/compression_lzma.md)
- [COMPRESSION_ZLIB](compression/compression_zlib.md)
- [COMPRESSION_BROTLI](compression/compression_brotli.md)
- [COMPRESSION_LZBITMAP](compression/compression_lzbitmap.md)
- [COMPRESSION_LZMESH](compression/compression_lzmesh.md)
