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

Open
opened 2026-01-29 20:44:52 +00:00 by claunia · 1 comment
Owner

Originally created by @mudinthewater on GitHub (Mar 12, 2024).

Using a 7314288 byte (~7MB) json file as an example:
image

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.

Originally created by @mudinthewater on GitHub (Mar 12, 2024). 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.
Author
Owner

@xnerhu commented on GitHub (Mar 26, 2025):

you can't trust python even with this little

Image

@xnerhu commented on GitHub (Mar 26, 2025): you can't trust python even with this little ![Image](https://github.com/user-attachments/assets/c6e799b2-9ca8-4688-8165-3929a379ac08)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#500