mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
strange behavior of brotli ... #382
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fenix-soft on GitHub (Mar 24, 2021).
I have compiled brotli v1.0.9 on a 32 bit linux ubuntu system with success, I have done some tests both using tar and with single files to be compressed using only brotli.
for example if I use this command:
brotli 1.targenerates me a file called "1.tar.br" but the compression phase inexplicably uses cpu and ram in a disproportionate way taking a long time, to consider that my test source code file in the tar file was big about 3MB .. in some cases for bigger tar files my machine cuts the compression due to insufficient memory. in the test machine I have installed 2 GB of ram.
if instead I manually tell brotli the compression level for example "-9 the maximum" with :
brotli -9 1.targenerates me a file called "1.tar.br", the compression lasts a few seconds without an intensive use of cpu or ram (so negligible that I don't notice it) this happens in all those cases that I manually set the compression level.
my question is .. is it normal that without setting a compression level it behaves that way?
brotli for defoult without parameters what level of compression does brotli use?
thanks for your attention, best regards
@eustas commented on GitHub (Mar 24, 2021):
Hello.
Command line help states that
--bestis used by default. Yes, it is a memory and CPU hungry mode.There is no consensus among compressors about what level should be used by default. For example gzip uses level 6 (in between fastest and best), but bzip2 uses level 9 (best).
For brotli we have decided to use the best level by default, because it is less discoverable (
-9is what user usually expects to be best). Personally I always specify compression level and few more options to cover my expectations (i.e.-Zfkof-9fk).