google / google/brotli

Default python compression level (11) causes more delay than it's worth on larger files

Open
#1,138 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14.9k
Forks
1.4k
Avg merge
4d 20h
Merged PRs (30d)
9

Description

Using a 7314288 byte (~7MB) json file as an example:
![image](https://github.com/google/brotli/assets/35539679/c8c6d2de-49e4-439f-887d-b0d021bce4dd)

The image is kinda blown out, so here's the raw data:

Quality | Compression Time | Size
-- | -- | --
0 | 0.011061668 | 287292
1 | 0.009209156 | 213457
2 | 0.018366814 | 184692
3 | 0.01734972 | 184569
4 | 0.023967743 | 177295
5 | 0.037658453 | 151161
6 | 0.042690992 | 150042
7 | 0.054255962 | 148143
8 | 0.072593212 | 147667
9 | 0.108716726 | 146448
10 | 1.435314894 | 130876
11 | 20.70757484 | 122797

I understand the desire to have the library put its highest compression quality out there first, but wouldn't it create an overall better impression on users if a faster default was used? Quality 8 provides nearly as good a result as 11, but it's almost 300 times faster.

Contributor guide

Open the contributing guide

Research direction

Start by locating the Python binding's default compression quality and the code or tests that define it. Compare the reported quality 8 and 11 timings and output sizes, then determine what benchmark or test should establish the new default; done means the default behavior and its documentation or tests consistently reflect the chosen quality.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.