mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-11 03:26:17 +08:00
Updated SM3性能优化 (markdown)
parent
6121e3dd7d
commit
27e5319293
84
SM3性能优化.md
84
SM3性能优化.md
@ -386,7 +386,7 @@ SM3可以对Wt XOR Wt+4进行并行计算,
|
||||
|
||||
如果只有(只剩)一个block (64字节),则只处理这个block,否则2个block(128字节)处理,两个block并行处理message scheduler。
|
||||
|
||||
# 结果
|
||||
# 结果(仅供参考)
|
||||
AMD64,非SHA256-NI。
|
||||
|
||||
|架构|SHA256|SM3|
|
||||
@ -394,4 +394,84 @@ AMD64,非SHA256-NI。
|
||||
|AVX2+BMI2|100%|~85%|
|
||||
|AVX|不支持|支持|
|
||||
|SSE|不支持|支持|
|
||||
|Normal ASM|支持|支持|
|
||||
|Normal ASM|支持|支持|
|
||||
|
||||
**AVX2(SM3):**
|
||||
```
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
pkg: github.com/emmansun/gmsm/sm3
|
||||
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
|
||||
BenchmarkHash1K
|
||||
BenchmarkHash1K-6
|
||||
404881 2663 ns/op 384.53 MB/s 0 B/op 0 allocs/op
|
||||
```
|
||||
|
||||
**AVX(SM3):**
|
||||
```
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
pkg: github.com/emmansun/gmsm/sm3
|
||||
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
|
||||
BenchmarkHash1K
|
||||
BenchmarkHash1K-6
|
||||
451285 2809 ns/op 364.54 MB/s 0 B/op 0 allocs/op
|
||||
```
|
||||
|
||||
**SSE(SSSE3 SSE2)(SM3):**
|
||||
```
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
pkg: github.com/emmansun/gmsm/sm3
|
||||
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
|
||||
BenchmarkHash1K
|
||||
BenchmarkHash1K-6
|
||||
390361 2936 ns/op 348.83 MB/s 0 B/op 0 allocs/op
|
||||
```
|
||||
|
||||
**普通汇编(SM3):**
|
||||
```
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
pkg: github.com/emmansun/gmsm/sm3
|
||||
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
|
||||
BenchmarkHash1K
|
||||
BenchmarkHash1K-6
|
||||
314943 3955 ns/op 258.88 MB/s 0 B/op 0 allocs/op
|
||||
```
|
||||
|
||||
**纯golang(SM3):**
|
||||
```
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
pkg: github.com/emmansun/gmsm/sm3
|
||||
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
|
||||
BenchmarkHash1K
|
||||
BenchmarkHash1K-6
|
||||
233209 4699 ns/op 217.91 MB/s 0 B/op 0 allocs/op
|
||||
```
|
||||
|
||||
|
||||
**AVX2(SH256):**
|
||||
```
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
pkg: github.com/emmansun/gmsm/sm3
|
||||
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
|
||||
BenchmarkHash1K_SH256
|
||||
BenchmarkHash1K_SH256-6
|
||||
508598 2281 ns/op 448.94 MB/s 0 B/op 0 allocs/op
|
||||
```
|
||||
**普通汇编(SH256):**
|
||||
```
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
pkg: github.com/emmansun/gmsm/sha256
|
||||
cpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
|
||||
BenchmarkHash1K
|
||||
BenchmarkHash1K-6
|
||||
260756 4525 ns/op 226.30 MB/s 0 B/op 0 allocs/op
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user