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

huff0: Improve 4X decompression speed 5-10% #437

Merged
merged 4 commits into from
Jan 8, 2022
Merged

Conversation

klauspost
Copy link
Owner

@klauspost klauspost commented Sep 7, 2021

Improve huffman 4X decompression speed for tablelog <= 8.

λ benchcmp before.txt after.txt
benchmark                                            old ns/op     new ns/op     delta
BenchmarkDecompress4XNoTable/digits-32               167490        158439        -5.40%
BenchmarkDecompress4XNoTable/gettysburg-32           2762          2782          +0.72%
BenchmarkDecompress4XNoTable/twain-32                578974        584448        +0.95%
BenchmarkDecompress4XNoTable/low-ent.10k-32          57714         54112         -6.24%
BenchmarkDecompress4XNoTable/superlow-ent-10k-32     15440         14349         -7.07%
BenchmarkDecompress4XNoTable/case1-32                232           215           -7.28%
BenchmarkDecompress4XNoTable/case2-32                181           172           -4.97%
BenchmarkDecompress4XNoTable/case3-32                187           178           -5.28%
BenchmarkDecompress4XNoTable/pngdata.001-32          78498         79716         +1.55%
BenchmarkDecompress4XNoTable/normcount2-32           299           270           -9.60%
BenchmarkDecompress4XTable/digits-32                 167728        158709        -5.38%
BenchmarkDecompress4XTable/gettysburg-32             3993          3956          -0.93%
BenchmarkDecompress4XTable/twain-32                  586985        584482        -0.43%
BenchmarkDecompress4XTable/low-ent.10k-32            58317         54652         -6.28%
BenchmarkDecompress4XTable/superlow-ent-10k-32       15895         14903         -6.24%
BenchmarkDecompress4XTable/case1-32                  2030          1996          -1.67%
BenchmarkDecompress4XTable/case2-32                  1986          1956          -1.51%
BenchmarkDecompress4XTable/case3-32                  2004          1980          -1.20%
BenchmarkDecompress4XTable/pngdata.001-32            81922         81627         -0.36%
BenchmarkDecompress4XTable/normcount2-32             1351          1339          -0.89%

Significant degradations, abandoned.

```
λ benchcmp before.txt after.txt
benchmark                                            old ns/op     new ns/op     delta
BenchmarkDecompress4XNoTable/digits-32               166962        183522        +9.92%
BenchmarkDecompress4XNoTable/gettysburg-32           2747          2783          +1.31%
BenchmarkDecompress4XNoTable/twain-32                579833        581783        +0.34%
BenchmarkDecompress4XNoTable/low-ent.10k-32          56815         65143         +14.66%
BenchmarkDecompress4XNoTable/superlow-ent-10k-32     15217         17399         +14.34%
BenchmarkDecompress4XNoTable/case1-32                223           215           -3.63%
BenchmarkDecompress4XNoTable/case2-32                178           173           -3.03%
BenchmarkDecompress4XNoTable/case3-32                186           178           -4.10%
BenchmarkDecompress4XNoTable/pngdata.001-32          78199         79470         +1.63%
BenchmarkDecompress4XNoTable/normcount2-32           295           280           -5.22%
BenchmarkDecompress4XTable/digits-32                 169105        186653        +10.38%
BenchmarkDecompress4XTable/gettysburg-32             4113          4243          +3.16%
BenchmarkDecompress4XTable/twain-32                  580482        589091        +1.48%
BenchmarkDecompress4XTable/low-ent.10k-32            57488         66318         +15.36%
BenchmarkDecompress4XTable/superlow-ent-10k-32       15801         18111         +14.62%
BenchmarkDecompress4XTable/case1-32                  2060          2062          +0.10%
BenchmarkDecompress4XTable/case2-32                  2004          2015          +0.55%
BenchmarkDecompress4XTable/case3-32                  2026          2040          +0.69%
BenchmarkDecompress4XTable/pngdata.001-32            81603         83582         +2.43%
BenchmarkDecompress4XTable/normcount2-32             1426          1401          -1.75%
```
@orijbot
Copy link

orijbot commented Sep 7, 2021

@klauspost
Copy link
Owner Author

Tons of unrelated deltas in benchmark. The related ones are better, though, so not sure what to think.

@klauspost klauspost changed the title huff0: 4X Decompression experiment huff0: Improve 4X decompression speed. Jan 8, 2022
@klauspost klauspost changed the title huff0: Improve 4X decompression speed. huff0: Improve 4X decompression speed 5-10% Jan 8, 2022
@klauspost klauspost merged commit f59d5b1 into master Jan 8, 2022
@klauspost klauspost deleted the huff0-4x-experiement branch January 8, 2022 18:26
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.

2 participants