Skip to content

Conversation

@klauspost
Copy link
Owner

Only seems to help very small encodes really:

benchmark                                                                 old ns/op     new ns/op     delta
BenchmarkTwainDecode1e1/default-32                                        24.5          12.6          -48.61%
BenchmarkTwainDecode1e1/better-32                                         25.2          12.6          -49.90%
BenchmarkTwainDecode1e1/best-32                                           25.8          12.6          -51.14%
BenchmarkTwainDecode1e1/snappy-input-32                                   25.1          12.6          -49.66%
BenchmarkTwainDecode1e2/default-32                                        51.9          42.3          -18.41%
BenchmarkTwainDecode1e2/better-32                                         75.1          59.2          -21.17%
BenchmarkTwainDecode1e2/best-32                                           74.3          55.9          -24.67%
BenchmarkTwainDecode1e2/snappy-input-32                                   74.1          57.4          -22.58%
BenchmarkTwainDecode1e3/default-32                                        189           163           -13.62%
BenchmarkTwainDecode1e3/better-32                                         607           577           -4.96%
BenchmarkTwainDecode1e3/best-32                                           634           616           -2.79%
BenchmarkTwainDecode1e3/snappy-input-32                                   519           480           -7.48%
BenchmarkTwainDecode1e4/default-32                                        4646          4690          +0.95%
BenchmarkTwainDecode1e4/better-32                                         11077         11151         +0.67%
BenchmarkTwainDecode1e4/best-32                                           11000         11364         +3.31%
BenchmarkTwainDecode1e4/snappy-input-32                                   11354         11460         +0.93%
BenchmarkTwainDecode1e5/default-32                                        139163        140259        +0.79%
BenchmarkTwainDecode1e5/better-32                                         236537        240051        +1.49%
BenchmarkTwainDecode1e5/best-32                                           233781        235656        +0.80%
BenchmarkTwainDecode1e5/snappy-input-32                                   268110        270810        +1.01%
BenchmarkTwainDecode1e6/default-32                                        1582443       1584509       +0.13%
BenchmarkTwainDecode1e6/better-32                                         2273135       2308712       +1.57%
BenchmarkTwainDecode1e6/best-32                                           2092574       2108555       +0.76%
BenchmarkTwainDecode1e6/snappy-input-32                                   2711775       2727778       +0.59%
BenchmarkTwainDecode1e7/default-32                                        15834966      15962745      +0.81%
BenchmarkTwainDecode1e7/better-32                                         22696148      22958016      +1.15%
BenchmarkTwainDecode1e7/best-32                                           20738425      20910498      +0.83%
BenchmarkTwainDecode1e7/snappy-input-32                                   27306220      27518433      +0.78%

Remove bounds checks and load faster.
@klauspost klauspost changed the title S2 go decoder bounds s2: Slightly faster non-assembly decompression Jul 22, 2022
@klauspost klauspost merged commit 6234e33 into master Jul 25, 2022
@klauspost klauspost deleted the s2-go-decoder-bounds branch July 25, 2022 14:07
jzelinskie added a commit to jzelinskie/spicedb that referenced this pull request Sep 16, 2022
This change includes up to 48% performance improvements for small S2
decompression:

klauspost/compress#646
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