On the master branch, only the best available SHA256
implementation is being benchmarked. This PR makes bench_bitcoin
benchmark all SHA256
implementations that are available on the system.
For example:
- on Linux:
0$ ./src/bench/bench_bitcoin -filter=SHA.*
1Using the 'x86_shani(1way,2way)' SHA256 implementation
2
3| ns/byte | byte/s | err% | total | benchmark
4|--------------------:|--------------------:|--------:|----------:|:----------
5| 1.00 | 1,002,545,462.93 | 0.4% | 0.01 | `SHA1`
6| 2.91 | 344,117,991.18 | 0.1% | 0.03 | `SHA256 using the 'standard' SHA256 implementation`
7| 2.21 | 453,081,794.40 | 0.1% | 0.02 | `SHA256 using the 'sse4(1way),sse41(4way)' SHA256 implementation`
8| 2.21 | 453,396,506.58 | 0.1% | 0.02 | `SHA256 using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation`
9| 0.53 | 1,870,520,687.49 | 0.1% | 0.01 | `SHA256 using the 'x86_shani(1way,2way)' SHA256 implementation`
10| 7.90 | 126,627,134.33 | 0.0% | 0.01 | `SHA256D64_1024 using the 'standard' SHA256 implementation`
11| 3.94 | 253,850,206.07 | 0.0% | 0.01 | `SHA256D64_1024 using the 'sse4(1way),sse41(4way)' SHA256 implementation`
12| 1.40 | 716,247,553.38 | 0.4% | 0.01 | `SHA256D64_1024 using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation`
13| 1.26 | 792,706,270.13 | 0.9% | 0.01 | `SHA256D64_1024 using the 'x86_shani(1way,2way)' SHA256 implementation`
14| 6.75 | 148,172,097.64 | 0.2% | 0.01 | `SHA256_32b using the 'standard' SHA256 implementation`
15| 4.90 | 204,156,289.96 | 0.1% | 0.01 | `SHA256_32b using the 'sse4(1way),sse41(4way)' SHA256 implementation`
16| 4.90 | 204,101,274.22 | 0.1% | 0.01 | `SHA256_32b using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation`
17| 1.70 | 589,052,595.35 | 0.4% | 0.01 | `SHA256_32b using the 'x86_shani(1way,2way)' SHA256 implementation`
18| 2.21 | 453,441,736.14 | 1.0% | 0.02 | `SHA3_256_1M`
19| 1.92 | 521,807,101.48 | 1.0% | 0.02 | `SHA512`
- on macOS (M1):
0% ./src/bench/bench_bitcoin -filter=SHA.\*
1Using the 'arm_shani(1way,2way)' SHA256 implementation
2
3| ns/byte | byte/s | err% | total | benchmark
4|--------------------:|--------------------:|--------:|----------:|:----------
5| 1.36 | 737,644,274.00 | 0.6% | 0.02 | `SHA1`
6| 3.08 | 324,556,777.15 | 0.2% | 0.03 | `SHA256 using the 'standard' SHA256 implementation`
7| 0.45 | 2,198,104,135.18 | 0.3% | 0.01 | `SHA256 using the 'arm_shani(1way,2way)' SHA256 implementation`
8| 8.84 | 113,131,299.18 | 0.0% | 0.01 | `SHA256D64_1024 using the 'standard' SHA256 implementation`
9| 0.94 | 1,059,406,239.36 | 0.0% | 0.01 | `SHA256D64_1024 using the 'arm_shani(1way,2way)' SHA256 implementation`
10| 6.17 | 162,050,659.51 | 0.2% | 0.01 | `SHA256_32b using the 'standard' SHA256 implementation`
11| 1.15 | 866,637,155.98 | 0.0% | 0.01 | `SHA256_32b using the 'arm_shani(1way,2way)' SHA256 implementation`
12| 1.69 | 592,636,491.59 | 0.2% | 0.02 | `SHA3_256_1M`
13| 1.89 | 528,785,775.66 | 0.0% | 0.02 | `SHA512`
Found it useful, while working on #24773.