Repository navigation
Upgrade sha2 to enable ARM hardware acceleration by default - #20831
Conversation
00d1a1b to
c6dcbaf
Compare
Merging this PR will improve performance by 6.94%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | hash_sha256 |
1.3 ms | 1.2 ms | +9.94% |
| ⚡ | Simulation | hash_sha256 |
17.9 ms | 16.9 ms | +5.85% |
| ⚡ | Simulation | prepare_wheel_many_files |
110.2 ms | 104.8 ms | +5.08% |
Tip
Curious why this is faster? Use the CodSpeed MCP and ask your agent.
Comparing zb/upgrade-sha2-arm-hardware (c6dcbaf) with main (7d9e4aa)2
Footnotes
-
6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(586d850) during the generation of this report, so 7d9e4aa was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
#20831 moves SHA-2 to `digest` 0.11, while `md-5` still depends on `digest` 0.10. That leaves the distribution hashing path using incompatible digest traits. Upgrade `md-5` to its stable 0.11 release so MD5 and SHA-2 share the same digest API without changing supported hashes or `--require-hashes` behavior. BLAKE2 remains on the older digest trait in this change; #20834 completes its migration separately. Co-authored-by: Zanie Blue <contact@zanie.dev>
#20831 and #20833 move SHA-2 and MD5 to `digest` 0.11, but the latest stable `blake2` release still depends on `digest` 0.10. This leaves the distribution hashing path with an unnecessary compatibility import for the older digest trait. Upgrade `blake2` to `0.11.0-rc.6` so MD5, SHA-2, and BLAKE2 share the same digest API. Preserve the existing 256-bit BLAKE2b output for local-wheel hash verification. This intentionally adopts a prerelease because no stable BLAKE2 release is compatible with `digest` 0.11 yet. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
sha20.10 only enables ARM SHA-256 acceleration through its optionalasmfeature, requiring thesha2-asmdependency and platform-specific configuration added in #20805.Upgrade to
sha20.11, which selects its ARM backend automatically when CPU feature detection is available. This preserves accelerated distribution hashing on Apple Silicon and Linux/Android ARM while removingsha2-asmand its target-specific configuration. Windows on ARM still falls back to software becausecpufeaturesdoes not yet support feature detection there (RustCrypto/utils#1124).The upgrade also moves SHA-2 to
digest0.11. Two follow-ups complete the migration for the other supported hash algorithms: #20833 upgradesmd-5to its stable 0.11 release, and #20834 upgradesblake2to0.11.0-rc.6, its first release compatible withdigest0.11.