blake2 simd benches produce unexpected results
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- rust
调研方向
首先运行为默认配置和 simd 配置显示的两个 cargo +nightly bench 命令,然后检查 Blake2 基准测试的入口点以及吞吐量的计算方式。当报告的 MB/s 值准确反映测得的基准测试时间,并且在两种配置之间保持一致时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
I ran blake2 tests with and without simd feature enabled and found that behavior is strange and doesn't make a lot of sense.
Default (no simd):
$ cargo +nightly bench
...
running 8 tests
test blake2b512_10 ... bench: 8 ns/iter (+/- 0) = 1250 MB/s
test blake2b512_100 ... bench: 74 ns/iter (+/- 4) = 1351 MB/s
test blake2b512_1000 ... bench: 708 ns/iter (+/- 85) = 1412 MB/s
test blake2b512_10000 ... bench: 7,005 ns/iter (+/- 531) = 1427 MB/s
test blake2s256_10 ... bench: 13 ns/iter (+/- 0) = 769 MB/s
test blake2s256_100 ... bench: 121 ns/iter (+/- 7) = 826 MB/s
test blake2s256_1000 ... bench: 1,155 ns/iter (+/- 62) = 865 MB/s
test blake2s256_10000 ... bench: 11,791 ns/iter (+/- 1,005) = 848 MB/s
test result: ok. 0 passed; 0 failed; 0 ignored; 8 measured; 0 filtered out; finished in 28.22s
Simd:
$ cargo +nightly bench --features simd
...
running 8 tests
test blake2b512_10 ... bench: 11 ns/iter (+/- 0) = 909 MB/s
test blake2b512_100 ... bench: 102 ns/iter (+/- 0) = 980 MB/s
test blake2b512_1000 ... bench: 1,010 ns/iter (+/- 11) = 990 MB/s
test blake2b512_10000 ... bench: 10,076 ns/iter (+/- 68) = 992 MB/s
test blake2s256_10 ... bench: 16 ns/iter (+/- 0) = 625 MB/s
test blake2s256_100 ... bench: 152 ns/iter (+/- 1) = 657 MB/s
test blake2s256_1000 ... bench: 1,483 ns/iter (+/- 12) = 674 MB/s
test blake2s256_10000 ... bench: 14,750 ns/iter (+/- 344) = 677 MB/s
test result: ok. 0 passed; 0 failed; 0 ignored; 8 measured; 0 filtered out; finished in 2.43s
I expected simd version to produce better results and judging by the total execution time it is the case, but throughput reported by the benchmark says the opposite.
I suspect something is wrong with benchmarking code.
Using latest master (cc523733e5ba84b5a366825a7d1150bbbfea368b right now) and rustc 1.65.0-nightly (20ffea693 2022-08-11).
- 主要语言
- Rust
- 星标
- 2.3k
- 派生
- 341
- 平均合并
- 12 小时 31 分钟
- 30 天内合并 PR
- 2
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RustCrypto/hashes 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 68/100
RustCrypto/hashes#912 ·
-
难度 4/5 3-5 天 新手友好度 38/100
RustCrypto/hashes#909 · 4 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
RustCrypto/hashes#908 ·
-
难度 5/5 一周以上 新手友好度 25/100
RustCrypto/hashes#763 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
RustCrypto/hashes#747 · 1 条评论 ·
查看 RustCrypto/hashes 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
bug core
难度 2/5 1-3 小时 新手友好度 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW 未关闭fuzz
难度 2/5 1-3 小时 新手友好度 82/100
ClickHouse/ClickHouse#122114 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
linebender/vello_svg#90 ·
-
难度 2/5 1-3 小时 新手友好度 74/100