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
Best values for lgwin and lgblock? #244
Comments
Does this solution make sense?
|
lgwin can be up to 24 in brotli, but the maximum you want to use depends on the capabilities of the client running the decoder. For the mobile web use it might be wise to avoid the levels 23 and 24, and possibly smart to stay at 19. |
lgwin of 24 bit means more than 50 MB of memory usage. the question is still active: does my code make sense, and wouldnt it be a good idea to add this functionality functionality to the param-class? |
This could easily be added to BrotliCompressBuffer method, but impossible for streaming versions (as the data size is unknown). So, if we add the logic that reduces window size to BrotliCompressBuffer, will it work for you? |
Why not add the size as an optional parameter to BrotliParams() constructor? |
It would look a little bit confusing and redundant - lgwin and lgblock already specify the expected use-case. Probably it can be done with some helper function that adjusts BrotliParams given the expected input size... |
Yes, that would be good. |
Basic formulae is max(24, min(10, log2(size)+0.5)), if memory itself is not a problem. |
Hi,
how can I calculate the best values for lgwin and lgblock?
If I use the default values to compress a buffer with only a few KB, brotli allocates 8 MB for the ringbuffer.
I think this makes no sense, so wouldnt it be a good idea to calculate the two values depending on the size of the data that should be compressed?
thx
The text was updated successfully, but these errors were encountered: