Commit 1b78e56
committed
Switch to SIMD-optimized SHA256 implementation
The SHA256 implementation provided by the github.com/minio/sha256-simd
package is measurably faster than the standard library's crypto/sha256
package:
```
name old speed new speed delta
StreamWriteTo/tar/1.0MiB-4 394MB/s ± 6% 1024MB/s ± 6% +160.10% (p=0.000 n=9+10)
StreamWriteTo/tar/8.0MiB-4 452MB/s ± 2% 1444MB/s ± 4% +219.48% (p=0.000 n=9+9)
StreamWriteTo/tar/16.0MiB-4 462MB/s ± 1% 1470MB/s ± 1% +218.07% (p=0.000 n=10+9)
StreamWriteTo/tar/128.0MiB-4 464MB/s ± 0% 1444MB/s ± 3% +211.36% (p=0.000 n=8+10)
StreamWriteTo/tgz/1.0MiB-4 310MB/s ± 9% 594MB/s ±13% +91.77% (p=0.000 n=10+8)
StreamWriteTo/tgz/8.0MiB-4 403MB/s ± 2% 1012MB/s ± 4% +150.86% (p=0.000 n=10+9)
StreamWriteTo/tgz/16.0MiB-4 408MB/s ± 1% 1069MB/s ± 4% +161.80% (p=0.000 n=9+10)
StreamWriteTo/tgz/128.0MiB-4 418MB/s ± 1% 1101MB/s ± 6% +163.57% (p=0.000 n=10+10)
```
Benchmark command:
```
go test -cpu=4 -benchtime=1s -count=10 -bench=. \
./internal/snapshotstream
```
Results compared using golang.org/x/perf/cmd/benchstat.1 parent 1c0f258 commit 1b78e56
3 files changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| |||
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| 165 | + | |
| 166 | + | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments