Utils for benchmarking and profiling

This commit is contained in:
RunasSudo 2022-08-21 02:24:24 +10:00
parent 974a56dffd
commit af4c6336aa
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
3 changed files with 14 additions and 0 deletions

3
.gitignore vendored
View File

@ -2,6 +2,9 @@
/html/opentally.js
/html/opentally_*.wasm
/benchmark*.log
/perf*.data
/homepage/_news.html
# Jekyll

7
benchmark.sh Executable file
View File

@ -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

4
profile.sh Executable file
View File

@ -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 $@