From af4c6336aab85881b8601aa08efac93a3353f16c Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 21 Aug 2022 02:24:24 +1000 Subject: [PATCH] Utils for benchmarking and profiling --- .gitignore | 3 +++ benchmark.sh | 7 +++++++ profile.sh | 4 ++++ 3 files changed, 14 insertions(+) create mode 100755 benchmark.sh create mode 100755 profile.sh diff --git a/.gitignore b/.gitignore index 2f43d2c..769c283 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ /html/opentally.js /html/opentally_*.wasm +/benchmark*.log +/perf*.data + /homepage/_news.html # Jekyll diff --git a/benchmark.sh b/benchmark.sh new file mode 100755 index 0000000..5451556 --- /dev/null +++ b/benchmark.sh @@ -0,0 +1,7 @@ +#!/bin/bash +cargo build --release || exit + +perf stat -r 5 -o benchmark.log ./target/release/opentally stv '/home/runassudo/git/stvdb/Australian Senate/2022/VIC.blt' --round-votes 0 --round-quota 0 --quota droop --quota-criterion geq --ties backwards random --random-seed 20210727 --surplus uig --surplus-order by_order --exclusion by_value --pp-decimals 0 $@ + +cat benchmark.log +git describe --always --dirty=-dev | tee -a benchmark.log diff --git a/profile.sh b/profile.sh new file mode 100755 index 0000000..65431d1 --- /dev/null +++ b/profile.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cargo build --profile perf || exit +/bin/rm perf.data +perf record -g --call-graph=dwarf ./target/perf/opentally stv '/home/runassudo/git/stvdb/Australian Senate/2022/VIC.blt' --round-votes 0 --round-quota 0 --quota droop --quota-criterion geq --ties backwards random --random-seed 20210727 --surplus uig --surplus-order by_order --exclusion by_value --pp-decimals 0 $@