Skip to content

zstd decode: Use compound decSymbol#144

Merged
klauspost merged 3 commits intomasterfrom
zstd-compund-decSymbol
Aug 3, 2019
Merged

zstd decode: Use compound decSymbol#144
klauspost merged 3 commits intomasterfrom
zstd-compund-decSymbol

Conversation

@klauspost
Copy link
Owner

@klauspost klauspost commented Jul 28, 2019

The compiler is not generating very nice code when decSymbol is separate values.

Use a compound value instead of a struct.

name                                     old time/op    new time/op    delta
Decoder_DecodeAll/kppkn.gtb.zst-12          604µs ± 1%     600µs ± 0%   -0.76%        (p=0.000 n=10+10)
Decoder_DecodeAll/geo.protodata.zst-12      136µs ± 1%     135µs ± 0%   -0.83%         (p=0.000 n=10+9)
Decoder_DecodeAll/plrabn12.txt.zst-12      1.94ms ± 1%    1.92ms ± 1%   -1.19%        (p=0.000 n=10+10)
Decoder_DecodeAll/lcet10.txt.zst-12        1.45ms ± 1%    1.43ms ± 0%   -1.69%         (p=0.000 n=10+8)
Decoder_DecodeAll/asyoulik.txt.zst-12       506µs ± 1%     497µs ± 1%   -1.78%         (p=0.000 n=9+10)
Decoder_DecodeAll/alice29.txt.zst-12        647µs ± 1%     641µs ± 0%   -0.85%         (p=0.000 n=10+9)
Decoder_DecodeAll/html_x_4.zst-12           263µs ± 1%     305µs ± 1%  +16.17%        (p=0.000 n=10+10)
Decoder_DecodeAll/paper-100k.pdf.zst-12    23.8µs ± 1%    23.8µs ± 1%     ~           (p=0.171 n=10+10)
Decoder_DecodeAll/fireworks.jpeg.zst-12    9.57µs ± 1%    9.56µs ± 0%     ~            (p=0.590 n=10+9)
Decoder_DecodeAll/urls.10K.zst-12          1.65ms ± 0%    1.64ms ± 1%     ~            (p=0.403 n=7+10)
Decoder_DecodeAll/html.zst-12               156µs ± 1%     154µs ± 1%   -0.85%        (p=0.012 n=10+10)

name                                     old speed      new speed      delta
Decoder_DecodeAll/kppkn.gtb.zst-12        305MB/s ± 1%   307MB/s ± 0%   +0.77%        (p=0.000 n=10+10)
Decoder_DecodeAll/geo.protodata.zst-12    869MB/s ± 1%   876MB/s ± 0%   +0.84%         (p=0.000 n=10+9)
Decoder_DecodeAll/plrabn12.txt.zst-12     249MB/s ± 1%   252MB/s ± 1%   +1.21%        (p=0.000 n=10+10)
Decoder_DecodeAll/lcet10.txt.zst-12       294MB/s ± 1%   299MB/s ± 0%   +1.72%         (p=0.000 n=10+8)
Decoder_DecodeAll/asyoulik.txt.zst-12     247MB/s ± 1%   252MB/s ± 1%   +1.81%         (p=0.000 n=9+10)
Decoder_DecodeAll/alice29.txt.zst-12      235MB/s ± 1%   237MB/s ± 0%   +0.86%         (p=0.000 n=10+9)
Decoder_DecodeAll/html_x_4.zst-12        1.56GB/s ± 1%  1.34GB/s ± 1%  -13.92%        (p=0.000 n=10+10)
Decoder_DecodeAll/paper-100k.pdf.zst-12  4.30GB/s ± 1%  4.31GB/s ± 1%     ~           (p=0.172 n=10+10)
Decoder_DecodeAll/fireworks.jpeg.zst-12  12.9GB/s ± 1%  12.9GB/s ± 0%     ~            (p=0.646 n=10+9)
Decoder_DecodeAll/urls.10K.zst-12         425MB/s ± 0%   427MB/s ± 1%     ~            (p=0.403 n=7+10)
Decoder_DecodeAll/html.zst-12             658MB/s ± 1%   663MB/s ± 1%   +0.86%        (p=0.008 n=10+10)

The compiler is not generating very nice code when decSymbol is separate values.

Use a compound value instead of a struct.

```
name                                     old time/op    new time/op    delta
Decoder_DecodeAll/kppkn.gtb.zst-12          610µs ± 1%     599µs ± 1%  -1.84%        (p=0.000 n=10+10)
Decoder_DecodeAll/geo.protodata.zst-12      138µs ± 2%     136µs ± 0%  -1.72%         (p=0.000 n=10+9)
Decoder_DecodeAll/plrabn12.txt.zst-12      1.95ms ± 1%    1.90ms ± 0%  -2.19%         (p=0.000 n=10+7)
Decoder_DecodeAll/lcet10.txt.zst-12        1.46ms ± 2%    1.42ms ± 1%  -2.48%        (p=0.000 n=10+10)
Decoder_DecodeAll/asyoulik.txt.zst-12       506µs ± 1%     497µs ± 1%  -1.83%         (p=0.000 n=10+9)
Decoder_DecodeAll/alice29.txt.zst-12        655µs ± 1%     636µs ± 1%  -2.97%        (p=0.000 n=10+10)
Decoder_DecodeAll/html_x_4.zst-12           267µs ± 1%     261µs ± 1%  -2.43%         (p=0.000 n=10+9)
Decoder_DecodeAll/paper-100k.pdf.zst-12    25.0µs ± 1%    24.3µs ± 1%  -2.61%        (p=0.000 n=10+10)
Decoder_DecodeAll/fireworks.jpeg.zst-12    9.65µs ± 1%    9.61µs ± 0%    ~            (p=0.250 n=10+9)
Decoder_DecodeAll/urls.10K.zst-12          1.67ms ± 1%    1.63ms ± 2%  -2.29%        (p=0.000 n=10+10)
Decoder_DecodeAll/html.zst-12               156µs ± 1%     155µs ± 1%  -0.85%        (p=0.014 n=10+10)

name                                     old speed      new speed      delta
Decoder_DecodeAll/kppkn.gtb.zst-12        302MB/s ± 1%   308MB/s ± 1%  +1.88%        (p=0.000 n=10+10)
Decoder_DecodeAll/geo.protodata.zst-12    860MB/s ± 2%   875MB/s ± 0%  +1.75%         (p=0.000 n=10+9)
Decoder_DecodeAll/plrabn12.txt.zst-12     248MB/s ± 1%   253MB/s ± 0%  +2.24%         (p=0.000 n=10+7)
Decoder_DecodeAll/lcet10.txt.zst-12       293MB/s ± 2%   300MB/s ± 1%  +2.54%        (p=0.000 n=10+10)
Decoder_DecodeAll/asyoulik.txt.zst-12     247MB/s ± 1%   252MB/s ± 1%  +1.86%         (p=0.000 n=10+9)
Decoder_DecodeAll/alice29.txt.zst-12      232MB/s ± 1%   239MB/s ± 1%  +3.06%        (p=0.000 n=10+10)
Decoder_DecodeAll/html_x_4.zst-12        1.53GB/s ± 1%  1.57GB/s ± 1%  +2.49%         (p=0.000 n=10+9)
Decoder_DecodeAll/paper-100k.pdf.zst-12  4.10GB/s ± 1%  4.21GB/s ± 1%  +2.68%        (p=0.000 n=10+10)
Decoder_DecodeAll/fireworks.jpeg.zst-12  12.8GB/s ± 1%  12.8GB/s ± 0%    ~            (p=0.286 n=10+9)
Decoder_DecodeAll/urls.10K.zst-12         420MB/s ± 1%   430MB/s ± 2%  +2.35%        (p=0.000 n=10+10)
Decoder_DecodeAll/html.zst-12             655MB/s ± 1%   661MB/s ± 1%  +0.86%        (p=0.015 n=10+10)
```
@klauspost klauspost merged commit 0e54620 into master Aug 3, 2019
@klauspost klauspost deleted the zstd-compund-decSymbol branch August 3, 2019 08:50
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

Comments