I believe #502 introduced a performance regression for users of the zlib-rs feature, introducing more zeroing of memory than before.
Edit 2026-04-15: Actually it seems the real regression here was async-compression's switch to the new decompress_uninit API, and the fact that decompress_uninit for the zlib-rs backend uses the default implementation, which results in excessive repeated zeroing of the same large output buffer when called repeatedly for small input chunks.
Profile with async-compression-0.4.30 and flate2-1.1.2: https://share.firefox.dev/4c0g66E
Profile with async-compression-0.4.41 and flate2-1.1.7: https://share.firefox.dev/4sXPEC8
In practice this is causing a download that took 2.7 seconds to now take 9.1 seconds.
cc @NobodyXu @Byron
I believe #502 introduced a performance regression for users of the zlib-rs feature, introducing more zeroing of memory than before.
Edit 2026-04-15: Actually it seems the real regression here was async-compression's switch to the new
decompress_uninitAPI, and the fact thatdecompress_uninitfor the zlib-rs backend uses the default implementation, which results in excessive repeated zeroing of the same large output buffer when called repeatedly for small input chunks.Profile with async-compression-0.4.30 and flate2-1.1.2: https://share.firefox.dev/4c0g66E
Profile with async-compression-0.4.41 and flate2-1.1.7: https://share.firefox.dev/4sXPEC8
In practice this is causing a download that took 2.7 seconds to now take 9.1 seconds.
cc @NobodyXu @Byron