VOOZH about

URL: https://www.phoronix.com/news/Mozilla-Firefox-zlib-rs-Usage

⇱ Mozilla Firefox Usage Of zlib-rs For Better Safety & Performance - Phoronix


👁 Phoronix

Mozilla Firefox Usage Of zlib-rs For Better Safety & Performance

Written by Michael Larabel in Mozilla on 16 June 2026 at 08:46 PM EDT. 18 Comments
Since the release in May of Firefox 151, Mozilla has been relying on the zlib-rs library for Gzip compression/decompression. This subtle change to use this Rust-based Zlib implementation has yielded some performance benefits and better memory safety but also some headaches when dealing with Intel CPU bugs.

The Trifecta Tech Foundation published details today on the Firefox usage of zlib-rs. They note conversations with Mozilla began two years before reaching the status of shipping zlib-rs in production on Firefox.

While zlib-rs is promoted as a "drop in" replacement to the C-based Zlib, in reality it didn't end up going quite so smoothly due to changes in the algorithms used at different compression levels. Zlib-rs was then also affected by the Intel 13th Gen / 14th Gen Core CPU stability issues. Fixing the Intel CPU issue ended up meaning a small amount of "unsafe" new code added.

👁 zlib-rs benchmarks


But in the end the zlib-rs implementation is delivering better memory safety and also much better performance, at least on x86_64. There are some noted smaller performance gains on AArch64 as areas where zlib-rs can better tune its code compared to the macOS zlib code shipped by Apple.

Read all the details about this zlib-rs crusade in Firefox at the Trifecta Tech Foundation blog.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.