-
Notifications
You must be signed in to change notification settings - Fork 21
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
Supply parameters for compression algorithms #22
Comments
I am expecting to add an options bundle as the second argument to the constructor. So for example we'd have something like new CompressionStream('deflate', {
level: 0.1,
flush: 'always'
}); How the parameters work will be difficult to fix if we get it wrong, which is why they aren't in the initial version of the standard. |
That makes perfect sense, thanks! :) |
I imagine that will also include the use of a custom dictionary? At present for Fastmail, we use pako in a worker to compress our API request bodies, and use a custom dictionary because it makes the compression much more effective. I had hoped that we could look to switching it to a standard API that would compress faster with less code loaded. Given the already-niche status of manual compression in JavaScript (for web systems specifically, I personally can’t think of having heard of even one other user, though doubtless some exist), I was a little surprised to hear of this shipping in Chrome without support for varying the compression level or providing a custom dictionary—it’s so rare that people want to do manual compression that I’d guess that a fair fraction of those that do use it have tuned things carefully, and so will not be able to use this new thing at this time without altering the balance. My surprise is probably because I believe supporting at least those two parameters (level and dictionary) to be quite straightforward, with a broad approach (an options object to the constructor) being obvious, and individual options decisions that should just be made, where discussion is unlikely to affect matters. For starters, I take it as given that the available options depend wholly on the compression method selected.
For compression, |
Yes, that's on the roadmap, although I don't think I've specifically mentioned it here. I filed issue #27 to make it explicit.
I believe in shipping the most uncontroversial parts of an API first. We need to assess demand to set the priority for shipping more advanced features.
Discussion does affect matters. You gave 4 different approaches to |
The parameter should be a float in [0..1], similar to Mapping to internal compression levels, like say libdeflate 12 for example, should be an unspecified internal implementation detail [1]. [1] |
@noell I didn't know about the I feel there should be some kind of restriction on implementations. For example, |
In addition to |
Even for built in algorithms (gzip and deflate), there are various parameters that users can supply which can unlock some use cases. Examples:
The text was updated successfully, but these errors were encountered: