Home GnuPG

Add new benchmarking utility, bench-slope
e214e8392671Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Add new benchmarking utility, bench-slope

* tests/Makefile.am (TESTS): Add 'bench-slope'.
* tests/bench-slope.c: New.

Bench-slope is new benchmarking tool for libgcrypt for obtaining overheadless
cycles/byte speed of cipher and hash algorithms. Tool measures the time each
operation (hash/encrypt/decrypt/authentication) takes for different buffer
sizes of from ~0kB to ~4kB and calculates the slope for these data points.
The default output is then given as nanosecs/byte and mebibytes/sec. If user
provides the speed of used CPU, tool also outputs cycles/byte result (CPU-Ghz *
ns/B = c/B).

Output without CPU speed (with ARM Cortex-A8):

$ tests/bench-slope hash

Hash:

|  nanosecs/byte   mebibytes/sec   cycles/byte

MD5 | 7.35 ns/B 129.7 MiB/s - c/B
SHA1 | 12.30 ns/B 77.53 MiB/s - c/B
RIPEMD160 | 15.96 ns/B 59.77 MiB/s - c/B
TIGER192 | 55.55 ns/B 17.17 MiB/s - c/B
SHA256 | 24.38 ns/B 39.12 MiB/s - c/B
SHA384 | 34.24 ns/B 27.86 MiB/s - c/B
SHA512 | 34.19 ns/B 27.90 MiB/s - c/B
SHA224 | 24.38 ns/B 39.12 MiB/s - c/B
MD4 | 5.68 ns/B 168.0 MiB/s - c/B
CRC32 | 9.26 ns/B 103.0 MiB/s - c/B
CRC32RFC1510 | 9.20 ns/B 103.6 MiB/s - c/B
CRC24RFC2440 | 87.31 ns/B 10.92 MiB/s - c/B
WHIRLPOOL | 253.3 ns/B 3.77 MiB/s - c/B
TIGER | 55.55 ns/B 17.17 MiB/s - c/B
TIGER2 | 55.55 ns/B 17.17 MiB/s - c/B
GOSTR3411_94 | 212.0 ns/B 4.50 MiB/s - c/B
STRIBOG256 | 630.1 ns/B 1.51 MiB/s - c/B
STRIBOG512 | 630.1 ns/B 1.51 MiB/s - c/B

=

With CPU speed (with Intel i5-4570, 3.2Ghz when turbo-boost disabled):

$ tests/bench-slope --cpu-mhz 3201 cipher arcfour blowfish aes
Cipher:
ARCFOUR | nanosecs/byte mebibytes/sec cycles/byte

STREAM enc |      2.43 ns/B     392.1 MiB/s      7.79 c/B
STREAM dec |      2.44 ns/B     390.2 MiB/s      7.82 c/B
           =

BLOWFISH | nanosecs/byte mebibytes/sec cycles/byte

ECB enc |      7.62 ns/B     125.2 MiB/s     24.38 c/B
ECB dec |      7.63 ns/B     125.0 MiB/s     24.43 c/B
CBC enc |      9.18 ns/B     103.9 MiB/s     29.38 c/B
CBC dec |      2.60 ns/B     366.2 MiB/s      8.34 c/B
CFB enc |      9.17 ns/B     104.0 MiB/s     29.35 c/B
CFB dec |      2.66 ns/B     358.1 MiB/s      8.53 c/B
OFB enc |      8.97 ns/B     106.3 MiB/s     28.72 c/B
OFB dec |      8.97 ns/B     106.3 MiB/s     28.71 c/B
CTR enc |      2.60 ns/B     366.5 MiB/s      8.33 c/B
CTR dec |      2.60 ns/B     367.1 MiB/s      8.32 c/B
        =

AES | nanosecs/byte mebibytes/sec cycles/byte

 ECB enc |     0.439 ns/B    2173.0 MiB/s      1.40 c/B
 ECB dec |     0.489 ns/B    1949.5 MiB/s      1.57 c/B
 CBC enc |      1.64 ns/B     580.8 MiB/s      5.26 c/B
 CBC dec |     0.219 ns/B    4357.6 MiB/s     0.701 c/B
 CFB enc |      1.53 ns/B     623.6 MiB/s      4.90 c/B
 CFB dec |     0.219 ns/B    4350.5 MiB/s     0.702 c/B
 OFB enc |      1.51 ns/B     629.9 MiB/s      4.85 c/B
 OFB dec |      1.51 ns/B     629.9 MiB/s      4.85 c/B
 CTR enc |     0.288 ns/B    3308.5 MiB/s     0.923 c/B
 CTR dec |     0.288 ns/B    3316.9 MiB/s     0.920 c/B
 CCM enc |      1.93 ns/B     493.8 MiB/s      6.18 c/B
 CCM dec |      1.93 ns/B     494.0 MiB/s      6.18 c/B
CCM auth |      1.64 ns/B     580.1 MiB/s      5.26 c/B
         =

Note: It's highly recommented to disable turbo-boost and dynamic CPU frequency
features when making these kind of measurements to reduce variance.

Note: The results are maximum performance for each operation; the actual speed
in application depends on various matters, such as: used buffer sizes, cache
usage, etc.

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Oct 26 2013, 2:00 PM
Parents
rCebc8abfcb09d: Change .global to .globl in assembly files
Branches
Unknown
Tags
Unknown

Event Timeline

Jussi Kivilinna <jussi.kivilinna@iki.fi> committed rCe214e8392671: Add new benchmarking utility, bench-slope (authored by Jussi Kivilinna <jussi.kivilinna@iki.fi>).Oct 28 2013, 10:29 AM