From 6ff111054c6cf304025f0936cfcd78abf4a4b357 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 21 Aug 2022 06:14:34 +1000 Subject: [PATCH] Profile using binary input --- benchmark.sh | 2 +- mkbaseline.sh | 3 +++ profile.sh | 9 +++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100755 mkbaseline.sh diff --git a/benchmark.sh b/benchmark.sh index ad7e8d6..0142236 100755 --- a/benchmark.sh +++ b/benchmark.sh @@ -1,7 +1,7 @@ #!/bin/bash cargo build --release || exit -perf stat -r 5 --table -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 $@ +perf stat -r 5 --table -o benchmark.log ./target/release/opentally stv tests/data/raw/VIC2022.bin --bin --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/mkbaseline.sh b/mkbaseline.sh new file mode 100755 index 0000000..83690e4 --- /dev/null +++ b/mkbaseline.sh @@ -0,0 +1,3 @@ +#!/bin/bash +mv benchmark.log benchmark.baseline.log +mv perf.data perf.baseline.data diff --git a/profile.sh b/profile.sh index 65431d1..3785d7f 100755 --- a/profile.sh +++ b/profile.sh @@ -1,4 +1,9 @@ #!/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 $@ +rm perf.data + +# Burn in +./target/perf/opentally stv tests/data/raw/VIC2022.bin --bin --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 $@ + +# Profile +perf record -g --call-graph=dwarf ./target/perf/opentally stv tests/data/raw/VIC2022.bin --bin --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 $@