-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add zlib-ng and refactor gzip open functions. #124
Conversation
benchmarks again:
After:
I am much more happy with the compression gradient. Level 3 is now actually an improvement over level 2 (albeit much slower). Zlib-ng does some really nice work. Only threads are missing, but it looks crabz will provide these when ready. I am also quite happy about how this PR turns out technically. It should be quite easy to add crabz after this and the logic has gotten a bit simpler. |
Superseded by #135 |
I added zlib-ng. This is great, but now we also have three competing library implementations for opening deflate compressed files:
Each of these has their own implementation programs as well. This means the choice for the "best" application becomes more situational. Also it is hard to correctly set all the initialization options.
I have therefore refactored the code. A list of preferred implementations is made. Then using a for loop and a try except the list is tried in order for an application that works. Application-specific options are set using functool.partial
This leads to more verbose code, but also in much simpler logic. Therefore this solution scales better. Since I expect crabz to be added soon, it is much easier to do that in this codebase.
Also this will work wonders for coverage as all the individual PipedCompression Readers and Writers are tested separately anyway and (almost) all the code in the opening functions is touched as there is only a single opening code line within a for loop.
It should be much more robust this way.