コンテンツへスキップ
uencoder

ハッシュ Performance Benchmarking リファレンス

リファレンス 用 ハッシュ 関数 performance characteristics, hardware acceleration, および benchmarking methodology.

Hardware Acceleration

Modern x86 CPUs provide SHA-NI instructions accelerating SHA-256 and SHA-1 by 3-4x. ARMv8 Crypto Extensions accelerate SHA-1, SHA-256, and SHA-512. SHA-3 acceleration (KECCAK) is less common but available on some recent processors. BLAKE2/3 use standard integer/vector instructions without dedicated hardware. Hardware acceleration can change the optimal hash choice for a given platform.

SHA-NI
x86 SHA-256 accel
3-4x speedup
ARMv8 crypto
SHA-1/256/512
mobile fast
no HW needed
BLAKE2/3 use SIMD
portable

Benchmarking Methodology

Hash benchmarks must warm up caches, use realistic input sizes, and report throughput (MB/s) and cycles/byte. Small input benchmarks are dominated by setup overhead; large inputs measure steady-state throughput. Memory bandwidth limits parallel hashes beyond a certain core count. SIMD width (SSE2, AVX2, AVX-512, NEON) significantly affects results. Always compare on the same hardware with identical compiler flags.

warmup
Prime caches and branch predictor
avoid cold-start
input sizes
Test range small to large
setup vs steady
SIMD
Vector width matters
AVX2 vs AVX-512

関連ツール

参考链接