Skip to content

Commit

Permalink
Add benchmarking scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Nov 26, 2017
1 parent 65cc23f commit 1d96ada
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
22 changes: 22 additions & 0 deletions admin/bench-measure.mk
@@ -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 changes: 18 additions & 0 deletions admin/bench-range
@@ -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)

0 comments on commit 1d96ada

Please sign in to comment.