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

inflate: 10-15% faster decompression #293

Merged
merged 2 commits into from
Nov 10, 2020
Merged

Conversation

klauspost
Copy link
Owner

λ benchcmp before.txt after.txt
benchmark                               old ns/op     new ns/op     delta
BenchmarkDecodeDigitsSpeed1e4-32        56514         52065         -7.87%
BenchmarkDecodeDigitsSpeed1e5-32        640875        554792        -13.43%
BenchmarkDecodeDigitsSpeed1e6-32        6402174       5513890       -13.87%
BenchmarkDecodeDigitsDefault1e4-32      61343         54619         -10.96%
BenchmarkDecodeDigitsDefault1e5-32      622027        537596        -13.57%
BenchmarkDecodeDigitsDefault1e6-32      6236843       5297780       -15.06%
BenchmarkDecodeDigitsCompress1e4-32     60749         54412         -10.43%
BenchmarkDecodeDigitsCompress1e5-32     676871        596456        -11.88%
BenchmarkDecodeDigitsCompress1e6-32     6749999       5935333       -12.07%
BenchmarkDecodeTwainSpeed1e4-32         59802         53984         -9.73%
BenchmarkDecodeTwainSpeed1e5-32         629727        547914        -12.99%
BenchmarkDecodeTwainSpeed1e6-32         6247368       5438356       -12.95%
BenchmarkDecodeTwainDefault1e4-32       59156         52760         -10.81%
BenchmarkDecodeTwainDefault1e5-32       584153        512330        -12.30%
BenchmarkDecodeTwainDefault1e6-32       5725959       4933883       -13.83%
BenchmarkDecodeTwainCompress1e4-32      56871         51282         -9.83%
BenchmarkDecodeTwainCompress1e5-32      535344        469828        -12.24%
BenchmarkDecodeTwainCompress1e6-32      5266667       4636718       -11.96%
BenchmarkDecodeRandomSpeed1e4-32        314           311           -0.96%
BenchmarkDecodeRandomSpeed1e5-32        1962          1955          -0.36%
BenchmarkDecodeRandomSpeed1e6-32        20149         20369         +1.09%

benchmark                               old MB/s     new MB/s     speedup
BenchmarkDecodeDigitsSpeed1e4-32        176.95       192.07       1.09x
BenchmarkDecodeDigitsSpeed1e5-32        156.04       180.25       1.16x
BenchmarkDecodeDigitsSpeed1e6-32        156.20       181.36       1.16x
BenchmarkDecodeDigitsDefault1e4-32      163.02       183.09       1.12x
BenchmarkDecodeDigitsDefault1e5-32      160.76       186.01       1.16x
BenchmarkDecodeDigitsDefault1e6-32      160.34       188.76       1.18x
BenchmarkDecodeDigitsCompress1e4-32     164.61       183.78       1.12x
BenchmarkDecodeDigitsCompress1e5-32     147.74       167.66       1.13x
BenchmarkDecodeDigitsCompress1e6-32     148.15       168.48       1.14x
BenchmarkDecodeTwainSpeed1e4-32         167.22       185.24       1.11x
BenchmarkDecodeTwainSpeed1e5-32         158.80       182.51       1.15x
BenchmarkDecodeTwainSpeed1e6-32         160.07       183.88       1.15x
BenchmarkDecodeTwainDefault1e4-32       169.04       189.54       1.12x
BenchmarkDecodeTwainDefault1e5-32       171.19       195.19       1.14x
BenchmarkDecodeTwainDefault1e6-32       174.64       202.68       1.16x
BenchmarkDecodeTwainCompress1e4-32      175.84       195.00       1.11x
BenchmarkDecodeTwainCompress1e5-32      186.80       212.84       1.14x
BenchmarkDecodeTwainCompress1e6-32      189.87       215.67       1.14x
BenchmarkDecodeRandomSpeed1e4-32        31888.50     32136.37     1.01x
BenchmarkDecodeRandomSpeed1e5-32        50976.74     51150.89     1.00x
BenchmarkDecodeRandomSpeed1e6-32        49629.09     49094.25     0.99x

```
λ benchcmp before.txt after.txt
benchmark                               old ns/op     new ns/op     delta
BenchmarkDecodeDigitsSpeed1e4-32        56514         52065         -7.87%
BenchmarkDecodeDigitsSpeed1e5-32        640875        554792        -13.43%
BenchmarkDecodeDigitsSpeed1e6-32        6402174       5513890       -13.87%
BenchmarkDecodeDigitsDefault1e4-32      61343         54619         -10.96%
BenchmarkDecodeDigitsDefault1e5-32      622027        537596        -13.57%
BenchmarkDecodeDigitsDefault1e6-32      6236843       5297780       -15.06%
BenchmarkDecodeDigitsCompress1e4-32     60749         54412         -10.43%
BenchmarkDecodeDigitsCompress1e5-32     676871        596456        -11.88%
BenchmarkDecodeDigitsCompress1e6-32     6749999       5935333       -12.07%
BenchmarkDecodeTwainSpeed1e4-32         59802         53984         -9.73%
BenchmarkDecodeTwainSpeed1e5-32         629727        547914        -12.99%
BenchmarkDecodeTwainSpeed1e6-32         6247368       5438356       -12.95%
BenchmarkDecodeTwainDefault1e4-32       59156         52760         -10.81%
BenchmarkDecodeTwainDefault1e5-32       584153        512330        -12.30%
BenchmarkDecodeTwainDefault1e6-32       5725959       4933883       -13.83%
BenchmarkDecodeTwainCompress1e4-32      56871         51282         -9.83%
BenchmarkDecodeTwainCompress1e5-32      535344        469828        -12.24%
BenchmarkDecodeTwainCompress1e6-32      5266667       4636718       -11.96%
BenchmarkDecodeRandomSpeed1e4-32        314           311           -0.96%
BenchmarkDecodeRandomSpeed1e5-32        1962          1955          -0.36%
BenchmarkDecodeRandomSpeed1e6-32        20149         20369         +1.09%

benchmark                               old MB/s     new MB/s     speedup
BenchmarkDecodeDigitsSpeed1e4-32        176.95       192.07       1.09x
BenchmarkDecodeDigitsSpeed1e5-32        156.04       180.25       1.16x
BenchmarkDecodeDigitsSpeed1e6-32        156.20       181.36       1.16x
BenchmarkDecodeDigitsDefault1e4-32      163.02       183.09       1.12x
BenchmarkDecodeDigitsDefault1e5-32      160.76       186.01       1.16x
BenchmarkDecodeDigitsDefault1e6-32      160.34       188.76       1.18x
BenchmarkDecodeDigitsCompress1e4-32     164.61       183.78       1.12x
BenchmarkDecodeDigitsCompress1e5-32     147.74       167.66       1.13x
BenchmarkDecodeDigitsCompress1e6-32     148.15       168.48       1.14x
BenchmarkDecodeTwainSpeed1e4-32         167.22       185.24       1.11x
BenchmarkDecodeTwainSpeed1e5-32         158.80       182.51       1.15x
BenchmarkDecodeTwainSpeed1e6-32         160.07       183.88       1.15x
BenchmarkDecodeTwainDefault1e4-32       169.04       189.54       1.12x
BenchmarkDecodeTwainDefault1e5-32       171.19       195.19       1.14x
BenchmarkDecodeTwainDefault1e6-32       174.64       202.68       1.16x
BenchmarkDecodeTwainCompress1e4-32      175.84       195.00       1.11x
BenchmarkDecodeTwainCompress1e5-32      186.80       212.84       1.14x
BenchmarkDecodeTwainCompress1e6-32      189.87       215.67       1.14x
BenchmarkDecodeRandomSpeed1e4-32        31888.50     32136.37     1.01x
BenchmarkDecodeRandomSpeed1e5-32        50976.74     51150.89     1.00x
BenchmarkDecodeRandomSpeed1e6-32        49629.09     49094.25     0.99x
```
@klauspost klauspost merged commit d693bc8 into master Nov 10, 2020
@klauspost klauspost deleted the inflate-table-and-inline branch November 10, 2020 09:03
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