5 ms·
Sane defaults matter. Why does brotli do maximum compression by default?
by mkesper 8y ago
Sane defaults matter. Why does brotli do maximum compression by default?
- JyrkiAlakuijala 8y agoWe chose max as default because Brotli actually compresses more at max setting. Gzip does not compress much more at max than it does at faster middle qualities, so they chose a default from middle qualities.
- klodolph 8y agoThere really is no such thing as a sane default for compression in general. There are three common use cases and each one demands different tradeoffs. Maximum compression is often suitable for compression once and decompression many times. Lower compression is useful for compression/decompression once. A middle value is useful for compression once/decompression less than once. Then you choose different values based on the relative costs of CPU, memory, network bandwidth, disk space, etc. “Maximum” is good because it handles a common use case. When you’re running a CLI tool, you’re much more likely to be processing static assets which are served many times. So “maximum” is a good guess of what the user wants.
- rossy 8y agoThe offline brotli compression tool uses maximum compression by default. The ngx_brotli module uses 6. I think that's reasonable. If you're compressing a file offline, you probably don't have big time constraints, so it makes sense to try to get the smallest size possible.