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

Improve performances of ungzip using CompressionStream #62

Open
lpatiny opened this issue Dec 1, 2022 · 1 comment
Open

Improve performances of ungzip using CompressionStream #62

lpatiny opened this issue Dec 1, 2022 · 1 comment

Comments

@lpatiny
Copy link
Member

lpatiny commented Dec 1, 2022

If the API is available is should be faster to use CompressionStream to ungzip the data.

@lpatiny
Copy link
Member Author

lpatiny commented Nov 3, 2024

Here is a code example

    case 'zlib':
      const ds = new DecompressionStream('deflate');
      const decompressedStream = new Blob([uint8Array])
        .stream()
        .pipeThrough(ds);
      const decompressedArrayBuffer = await new Response(
        decompressedStream,
      ).arrayBuffer();
      uint8Array = new Uint8Array(decompressedArrayBuffer);
      break;

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

1 participant