Skip to content
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 CodecZlibExt to use faster deflate decompression #173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkitti
Copy link

@mkitti mkitti commented Aug 29, 2024

Currently, TiffImages.jl uses Inflate.jl to decompress TIFF files that use deflate decompression.

This pull request creates a package extension CodecZlibExt that will use CodecZlib for delfate
decompression if it is already loaded.

This PR uses a Ref that can be modified via TiffImages.set_zlib_decompression_stream!.
That function is invoked the init function of the extension.

The main reason for wanting to use CodecZlib.jl is that it is much faster than Inflate.jl
for decompression.

@KristofferC
Copy link

KristofferC commented Aug 29, 2024

This seems like a bit unusual use case for an extension. Why not just change fully to CodecZlib if it is better?

One issue in my opinion with using an extension is that the default will change if any transitive dependency happen to load CodecZlib so you can get kind of spooky action at a distance from this.

@mkitti
Copy link
Author

mkitti commented Aug 29, 2024

@KristofferC, part of the idea of TiffImages.jl is that it has very few non-Julia dependencies. I would like to respect that choice while providing the option.

After sleeping on this, I think introducing Preferences.jl to select the Zlib backend may make more sense rather than the mechanism I initially wrote here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants