-
Notifications
You must be signed in to change notification settings - Fork 250
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
Consider using different compression (brotli) #10
Comments
Interesting. I'll look into it :) |
The only real trade-off is the size of that dictionary - it is nearly 1MB, which becomes expensive to serve over many loads. lzma had the benefit of being small, ~10k. I'll try it as an alternate mode, though. |
Looks to me like the full official decoder (js version) is only 150 kB (70kB compressed) check out this complete example: https://gist.github.com/phiresky/ff29eeef882aaf002d7b747ec04f6113 |
The decoder is easy, but looks like it's harder to find a working, compact JS encoder for brotli without external dependencies. |
Yeah, I'm trying to get one, but running into this bug: foliojs/brotli.js#20 |
Just for fun, I compiled the Rust Brotli implementation to WebAssembly. It works pretty well, the encoder is 970kB (470kB compressed). See here: https://phiresky.github.io/rust-brotli-wasm/brotli-wasm-bindgen/dist/example.html (code) No idea if all browsers support webassembly yet though, and I'm too lazy to transpile it down to asm.js. |
Just wanted to let you know that brotli significantly improves compression for this usecase, probably mostly because of brotli's integrated dictionary.
For the landing page:
Declaration of independence:
A JS implementation of brotli is here.
The text was updated successfully, but these errors were encountered: