Skip to content

Add CodecZlibExt to use faster deflate decompression - #173

Open
mkitti wants to merge 1 commit into
tlnagy:masterfrom
mkitti:mkitti-codeczlib-ext
Open

Add CodecZlibExt to use faster deflate decompression#173
mkitti wants to merge 1 commit into
tlnagy:masterfrom
mkitti:mkitti-codeczlib-ext

Conversation

@mkitti

@mkitti mkitti commented Aug 29, 2024

Copy link
Copy Markdown

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

KristofferC commented Aug 29, 2024

Copy link
Copy Markdown

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

mkitti commented Aug 29, 2024

Copy link
Copy Markdown
Author

@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.

@tlnagy

tlnagy commented Oct 10, 2024

Copy link
Copy Markdown
Owner

@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.

This is correct. A full Julia (or as close as we can get) stack gives us a lot more maintainable and flexible code. I appreciate @mkitti's focus on this.

Is this PR still alive or should I go ahead and close?

@mkitti

mkitti commented Oct 11, 2024

Copy link
Copy Markdown
Author

We need to resolve Julia compat bounds, but yes this is very much alive.

@BioTurboNick BioTurboNick mentioned this pull request Mar 23, 2026
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.

3 participants