Skip to content
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

lib/deflate_compress: select min_size_to_compress based on level #92

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

ebiggers
Copy link
Owner

The cutoff for outputting uncompressed data is currently < 16 bytes for
all compression levels. That isn't ideal, since the higher the
compression level, the more we should bother with very small inputs; and
the lower the compression level, the less we should bother.

Use a formula that produces the following cutoffs:

    Level  Cutoff
    -----  ------
    0      56
    1      52
    2      48
    3      44
    4      40
    5      36
    6      32
    7      28
    8      24
    9      20
    10     16
    11     12
    12     8

Update #67

The cutoff for outputting uncompressed data is currently < 16 bytes for
all compression levels.  That isn't ideal, since the higher the
compression level, the more we should bother with very small inputs; and
the lower the compression level, the less we should bother.

Use a formula that produces the following cutoffs:

        Level  Cutoff
        -----  ------
        0      56
        1      52
        2      48
        3      44
        4      40
        5      36
        6      32
        7      28
        8      24
        9      20
        10     16
        11     12
        12     8

Update #67
@ebiggers ebiggers merged commit 166084a into master Oct 19, 2020
@ebiggers ebiggers deleted the min_size_to_compress branch October 19, 2020 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant