Mozilla Firefox Usage Of zlib-rs For Better Safety & Performance
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.
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.
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.
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.
