-
Notifications
You must be signed in to change notification settings - Fork 183
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
Allowdecoder.decodeBlock
to be async
#172
Comments
Similarly in zarr.js we allow each codec to return a buffer or promise for a buffer and then await the result regardless since |
PoolOrDecoder.decode
to be asyncdecoder.decodeBlock
to be async
I created If you are interested in including |
Hi @manzt Using Regarding the LZW implementation: it would be great to have some performance and byte size comparisons between the options. Do you think you can provide that information? zarr.js looks like a very interesting project! |
Great! I'll make a PR for the async decoders.
Since the current LZW works for some cases, I'd hesitate to suggest adding a ~50kb module unless totally necessary (even if there was a substantial performace benefit). Like I said, it might be more productive to think about enabling users to provide their own decoders and enable treeshaking of the default geotiff.js/src/geotiffimage.js Line 469 in 7d4a7ab
For example in our
Anecdotaly, the current lzw implementation requires on the order of 10s of seconds to decode a single 1024x1024 tile for some of our images and often results with an OUT OF MEMORY error. The You can see a GIF of it in action here in Viv: hms-dbmi/viv#277 |
Yup! |
I have been experimenting with using a WASM decoder as the current implementation isn't very performant for some of the images we are working with. Specifically I wanted to experiment with
fast-lzw
, but since all decoding is synchronous in geotiff, I can't just define a new decoder easily sincefast-lzw.LZW.decompressAll
is an async function.In general, WASM based modules require some async initialization and since
PoolOrDecoder.decode
is only called in an async functiongetTileOrStrip
, awaiting the results ofthis.decodeBlock
would allow more flexibility in decoder implementations.Proposed change
The text was updated successfully, but these errors were encountered: