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

Brotli decompression using JS implementation from Google (#267) #7749

Closed
wants to merge 1 commit into from

Conversation

vlechemin
Copy link
Contributor

@vlechemin vlechemin commented Dec 20, 2023

What does this PR do?

It implements brotli decompression (#267) in JS using:
https://github.com/google/brotli/blob/master/js/decode.js

The file size is pretty big, I'm not sure of the impact on performance. If the impact is too high for those not using brotli, we could remove the dictionary, it is supposed to work anyway (https://en.wikipedia.org/wiki/Brotli#cite_note-14).

Pushing decoded chunks in the transform method does not work but I didnt investigate why because this version should be equivalent speed wise. The test case is pretty big so I did not include it.

Thanks to @paperdave for his help on Discord.

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

  • I included a test for the new code, or existing tests cover it
  • I ran my tests locally and they pass (bun-debug test test/js/node/zlib/zlib.test.js)

@vlechemin vlechemin marked this pull request as ready for review December 20, 2023 02:47
@Jarred-Sumner
Copy link
Collaborator

Thank you for this. I really appreciate the time you spent on this PR, but I have some bad news.

This is something that's very performance sensitive, which means it must be implemented in native code. Ideally using the official library.

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