Permalink
Browse files

Add benchmarking scripts

  • Loading branch information...
ctz committed Nov 22, 2017
1 parent 65cc23f commit 1d96adaa70f586ca0938af21c3e706d62fa6c2f5
Showing with 40 additions and 0 deletions.
  1. +22 −0 admin/bench-measure.mk
  2. +18 −0 admin/bench-range
View
@@ -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
View
@@ -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.