Skip to content

chore: update flate2 version & use zlib-rs#576

Open
jorgehermo9 wants to merge 2 commits intocloudflare:mainfrom
jorgehermo9:chore/use-zlib-rs
Open

chore: update flate2 version & use zlib-rs#576
jorgehermo9 wants to merge 2 commits intocloudflare:mainfrom
jorgehermo9:chore/use-zlib-rs

Conversation

@jorgehermo9
Copy link
Copy Markdown

@jorgehermo9 jorgehermo9 commented Mar 30, 2025

As described in this blog post https://trifectatech.org/blog/zlib-rs-is-faster-than-c/ zlib-rs is a faster and pure Rust zlib alternative and those performance upgrades are included in flate2 1.1.

What are your thoughts on adopting it?

@jorgehermo9
Copy link
Copy Markdown
Author

I think tests are broken due to what was commented in #569 or #572

@drcaramelsyrup drcaramelsyrup added the dependencies Pull requests that update a dependency file label Apr 4, 2025
@JosiahParry
Copy link
Copy Markdown

Would there be a possibility of creating a feature for using zlib-rs instead of libz-ng-sys as a backend? It would be great if the required system dependencies can be reduced.

@jorgehermo9
Copy link
Copy Markdown
Author

jorgehermo9 commented Jun 2, 2025

Hi @drcaramelsyrup, Just noticed that I had this PR forgotten. Merged with main and now CI passes!

As @JosiahParry, Is there any need to let users configure their flate2 feature flag? or should we just use zlib-rs always?

@DarrenASmith
Copy link
Copy Markdown

Any chance this could be merged?
We are having problems with the dependency on "zlib-ng" which then tries to build with cmake and would like the option to be able to use "zlib-rs" instead

@JosiahParry
Copy link
Copy Markdown

sorry i never replied! 🙈 my specific use case is for a binary which doesn't need to expose feature flags to users

@jorgehermo9
Copy link
Copy Markdown
Author

@JosiahParry

I'm not sure if I'm understanding you correctly

Do you mean to let the dependent packages of pingora-core to control that feature flag, through pingora-core's own features? So we let them control the flate2 features themselves... Or what do you mean?

@DarrenASmith
Copy link
Copy Markdown

@JosiahParry

I'm not sure if I'm understanding you correctly

Do you mean to let the dependent packages of pingora-core to control that feature flag, through pingora-core's own features? So we let them control the flate2 features themselves... Or what do you mean?

If that's possible, that would work for my use case.
ie. pingora with "zlib-rs" feature sets that feature on it's flate2 dependency.
(the PR merged as is with the dependency hard-coded to zlib-rs would also be fine for my use case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants