Skip to main content
The XBOX Series consoles support hardware decompression for zlib compressed content using DirectStorage. Provided here is a drop-in replacement for the stock software zlib inflate function. Using this code can allow a developer to add support for accelerated hardware decompression with the minimum number of changes to their code. It will provide an immediate improvement in decompression times while also freeing up CPU resources that can be used for other work. A one-time initialization is needed to create the DirectStorage objects being used for hardware decompression.
Hardware decompression has a minimum setup cost, because of this it can be faster to use software decompression for smaller block sizes. A table of times is provided below using ASCII text as the source buffer. You should profile to find the best cross-over size against your software decompressor and content. There is an assumption in this code that the compressed content conforms to the supported IETF RFC 1950 zlib standard. See Optimizing compressed content by using DirectStorage and XBTC (microsoft.com) for more details.
This table provides a measurement of times for the stock software zlib decompressor versus the hardware decompressor from an XBOX Series X|S running at 3.8GHz using ASCII text as the source buffer. Different compression ratios will create different cross-over points for which is faster between software and hardware. You should profile to find the best cross-over size against your software decompressor and content. Block size is in bytes and times are in microseconds.
Last modified on August 20, 2026