We need to choose what the first module we migrate to Rust will be. This will be the only module we port in 3.16. I see three leading options (but please suggest other options if they seem compelling!):
base64
Base64 is a very commonly used algorithm that is also relatively simple. We could use https://docs.rs/base64/latest/base64/ which supports multiple alphabets and padding behaviors which would make implementation much easier, and performs significantly better than the _binascii C implementation. We could also use https://docs.rs/base64-simd/latest/base64_simd/ which would be even faster.
zlib
zlib is used in web compression, zip files (notably including wheels!), gzip files, and many other places. We could use https://github.com/trifectatechfoundation/zlib-rs which is faster than zlib, and about as fast as zlib-ng. The output might differ compared to zlib as the implementation is based on zlib-ng.
bz2
The bz2 module is not used nearly as much as the other two, but that can be a blessing if we want to reduce risks. We could use https://github.com/trifectatechfoundation/libbzip2-rs, which is a safe bzip2 implementation which is also 5-10% faster. I think the benefit here would be a performance and safety gain. The output should also be identical to the existing ubiquitous C library which may not be the case for zlib.
We need to choose what the first module we migrate to Rust will be. This will be the only module we port in 3.16. I see three leading options (but please suggest other options if they seem compelling!):
base64
Base64 is a very commonly used algorithm that is also relatively simple. We could use https://docs.rs/base64/latest/base64/ which supports multiple alphabets and padding behaviors which would make implementation much easier, and performs significantly better than the _binascii C implementation. We could also use https://docs.rs/base64-simd/latest/base64_simd/ which would be even faster.
zlib
zlib is used in web compression, zip files (notably including wheels!), gzip files, and many other places. We could use https://github.com/trifectatechfoundation/zlib-rs which is faster than zlib, and about as fast as zlib-ng. The output might differ compared to zlib as the implementation is based on zlib-ng.
bz2
The bz2 module is not used nearly as much as the other two, but that can be a blessing if we want to reduce risks. We could use https://github.com/trifectatechfoundation/libbzip2-rs, which is a safe bzip2 implementation which is also 5-10% faster. I think the benefit here would be a performance and safety gain. The output should also be identical to the existing ubiquitous C library which may not be the case for zlib.