Switch to libz-rs-sys for zlib implementation by coolreader18 · Pull Request #5562 · RustPython/RustPython
Conversation
This is a rust-only reimplementation of the libz-sys api, which I discovered from this blog post. It can build without any C toolchain, which makes it a good pick for us when we're targeting windows and wasm, and the performance isn't anything to scoff at (see blog post). Also, the zlib feature now enables the entire zlib module, which I feel like just makes more sense.
It's a reasonably heavy dependency (~500KB), so I figured it might be nice to still have the option to turn it off.
We don't suggest feature for every library which can be a redundant dependencies. If the binary size matters, turning off the entire stdlib feature and consist their own well-selected (or we can suggest a few pre-selected) set of libraries will make more sense.
Probably we can remove zlib feature from rustpython crate but add a lot of features for each library in rustpython-stdlib as a user interface to support easy library on/off. (not a scope of this pr)