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

Use browser-native DecompressionStreams #61

Open
tuner opened this issue Aug 15, 2023 · 2 comments
Open

Use browser-native DecompressionStreams #61

tuner opened this issue Aug 15, 2023 · 2 comments

Comments

@tuner
Copy link

tuner commented Aug 15, 2023

(De)compression streams are now supported in all web browsers: https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream

Pako is pretty fat and slow. There's also fflate, which is faster and more lightweight, but migrating to that doesn't make much sense now that a native solution is available. Maybe compression streams could be used by default with fallback to pako (at least for now) ?

Context: I was experimenting with tabix & gff-js and there seems to be several optimization opportunities. However, this would probably the most straightforward one, assuming that the native decompression stream is at least as performant as fflate is.

image

@cmdcolin
Copy link
Contributor

this would be great...would definitely be interested to check if it can handle bgzf, that is one of the tricky parts of our pako code

@cmdcolin
Copy link
Contributor

(note that we have built up some maybe awkward stuff around creating virtual file offsets based ids based on the pako code over time, but we could maybe make new workarounds based on decompression stream also)

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

No branches or pull requests

2 participants