Add benchmarking scripts

This commit is contained in:
Joseph Birr-Pixton 2017-11-22 22:16:48 +00:00
parent 65cc23fc83
commit 1d96adaa70
2 changed files with 40 additions and 0 deletions

22
admin/bench-measure.mk Normal file
View File

@ -0,0 +1,22 @@
perf: ./target/release/examples/bench
perf record -F999 --call-graph dwarf -- ./target/release/examples/bench bulk TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
perf script | ~/FlameGraph/stackcollapse-perf.pl | ~/FlameGraph/flamegraph.pl > perf-aes256-rustls.svg
perf record -F999 --call-graph dwarf -- ./target/release/examples/bench bulk TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
perf script | ~/FlameGraph/stackcollapse-perf.pl | ~/FlameGraph/flamegraph.pl > perf-aes128-rustls.svg
perf record -F999 --call-graph dwarf -- ./target/release/examples/bench bulk TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
perf script | ~/FlameGraph/stackcollapse-perf.pl | ~/FlameGraph/flamegraph.pl > perf-chacha-rustls.svg
perf record -F999 --call-graph dwarf -- ./target/release/examples/bench handshake TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
perf script | ~/FlameGraph/stackcollapse-perf.pl | ~/FlameGraph/flamegraph.pl > perf-fullhs-rustls.svg
perf record -F999 --call-graph dwarf -- ./target/release/examples/bench handshake-resume TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
perf script | ~/FlameGraph/stackcollapse-perf.pl | ~/FlameGraph/flamegraph.pl > perf-resume-rustls.svg
perf record -F999 --call-graph dwarf -- ./target/release/examples/bench handshake-ticket TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
perf script | ~/FlameGraph/stackcollapse-perf.pl | ~/FlameGraph/flamegraph.pl > perf-ticket-rustls.svg
measure: ./target/release/examples/bench
$^ bulk TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
$^ bulk TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
$^ bulk TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
$^ handshake TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
$^ handshake-resume TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
$^ handshake-ticket TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

18
admin/bench-range Executable file
View File

@ -0,0 +1,18 @@
import subprocess
suite = 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'
print 'len,send,recv'
for len in [16, 32, 64, 128, 512, 1024, 4096, 8192, 32768, 65536, 131072, 262144, 1048576]:
out = subprocess.check_output(['./target/release/examples/bench', 'bulk', suite, str(len)])
lines = out.splitlines()
for l in out.splitlines():
items = l.split()
if items[3] == 'send':
send = float(items[4])
if items[3] == 'recv':
recv = float(items[4])
print '%d,%g,%g' % (len, send, recv)