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

s2: Avoid Decode size checks #328

Merged
merged 1 commit into from
Mar 2, 2021
Merged

s2: Avoid Decode size checks #328

merged 1 commit into from
Mar 2, 2021

Commits on Mar 2, 2021

  1. s2: Avoid Decode size checks

    Add another decode loop that doesn't check sizes as long as src is big enough.
    
    For now only in Go version.
    
    Streams:
    ```
    Before: Decompressing. 426243297 -> 1000000000 [234.61%]; 1.941s, 491.3MB/s
    After:  Decompressing. 426243297 -> 1000000000 [234.61%]; 1.895s, 503.3MB/s
    ```
    
    Some blocks like it a lot:
    ```
    BenchmarkDecodeS2Block/4-pdf/block-32                      379           336           -11.35%
    BenchmarkDecodeS2Block/4-pdf/block-better-32               691           630           -8.83%
    BenchmarkDecodeS2Block/4-pdf/block-best-32                 816           702           -13.97%
    BenchmarkDecodeS2Block/5-html4/block-32                    13645         8727          -36.04%
    BenchmarkDecodeS2Block/5-html4/block-better-32             14059         9204          -34.53%
    BenchmarkDecodeS2Block/5-html4/block-best-32               13729         8975          -34.63%
    ```
    klauspost committed Mar 2, 2021
    Configuration menu
    Copy the full SHA
    48aaad4 View commit details
    Browse the repository at this point in the history