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

flate: Improve huffman generation speed ~5% faster #490

Merged
merged 1 commit into from Feb 5, 2022

Commits on Feb 5, 2022

  1. flate: Improve huffman generation speed ~5-10% faster

    Mainly gains for small blocks:
    
    ```
    benchmark                               old ns/op     new ns/op     delta
    BenchmarkEncodeDigitsConstant1e4-32     16080         15984         -0.60%
    BenchmarkEncodeDigitsSpeed1e4-32        48105         45890         -4.60%
    BenchmarkEncodeDigitsDefault1e4-32      114016        111234        -2.44%
    BenchmarkEncodeDigitsCompress1e4-32     228570        225041        -1.54%
    BenchmarkEncodeDigitsSL1e4-32           46695         45006         -3.62%
    BenchmarkEncodeTwainConstant1e4-32      23557         22033         -6.47%
    BenchmarkEncodeTwainSpeed1e4-32         68594         63177         -7.90%
    BenchmarkEncodeTwainDefault1e4-32       112498        111798        -0.62%
    BenchmarkEncodeTwainCompress1e4-32      282909        274804        -2.86%
    BenchmarkEncodeTwainSL1e4-32            68406         62362         -8.84%
    
    benchmark                               old MB/s     new MB/s     speedup
    BenchmarkEncodeDigitsConstant1e4-32     621.89       625.64       1.01x
    BenchmarkEncodeDigitsSpeed1e4-32        207.88       217.91       1.05x
    BenchmarkEncodeDigitsDefault1e4-32      87.71        89.90        1.02x
    BenchmarkEncodeDigitsCompress1e4-32     43.75        44.44        1.02x
    BenchmarkEncodeDigitsSL1e4-32           214.16       222.19       1.04x
    BenchmarkEncodeTwainConstant1e4-32      424.51       453.87       1.07x
    BenchmarkEncodeTwainSpeed1e4-32         145.79       158.29       1.09x
    BenchmarkEncodeTwainDefault1e4-32       88.89        89.45        1.01x
    BenchmarkEncodeTwainCompress1e4-32      35.35        36.39        1.03x
    BenchmarkEncodeTwainSL1e4-32            146.19       160.35       1.10x
    ```
    klauspost committed Feb 5, 2022
    Copy the full SHA
    176d63f View commit details
    Browse the repository at this point in the history