Skip to content

Commit

Permalink
Add perftest run script
Browse files Browse the repository at this point in the history
  • Loading branch information
cannam committed May 7, 2021
1 parent a3a2164 commit 577793e
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion repoint-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"pin": "152b25e2b9d7"
},
"bsq-perftest": {
"pin": "7d686478037e"
"pin": "1dbecf2d7092"
},
"ext/smldoc": {
"pin": "8b09c0c6045dd68154d8cceff90b9892f207cf64"
Expand Down
68 changes: 68 additions & 0 deletions scripts/run-perftests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

set -eu
if [ ! -f scripts/run-perftests.sh ] ; then
echo "This must be run from the project root directory"
exit 1
fi
infile=bsq-perftest/audio/50ft.wav
if [ ! -f "$infile" ]; then
echo "Unable to find input audio file $infile"
exit 1
fi

buildtypes="polyml mlton_release"

for b in $buildtypes; do
if [ -d "tmp_perfbuild_$b" ]; then
meson "tmp_perfbuild_$b" -D"sml_buildtype=$b" --reconfigure
else
meson "tmp_perfbuild_$b" -D"sml_buildtype=$b"
fi
ninja -C "tmp_perfbuild_$b"
done

tests=$(tmp_perfbuild_polyml/bsq_perftest |
grep 'one of' |
sed 's/^.*one of: //' |
sed 's/,//g')
echo "Tests are: $tests"

echo
hg id
hg log -r$(hg id | sed 's/+//' | awk '{ print $1; }') |
grep '^date:' |
sed 's/^date: */Commit date: /'

echo
echo -ne "\t\t\t"
for b in $buildtypes; do
echo -ne "$b\t\t"
done
echo

for test in $tests; do
echo -ne " $test\t\t"
for b in $buildtypes; do
args=""
case "$b" in
polyml) args="--minheap 500M";;
*) ;;
esac
elapsed=$(/usr/bin/time "tmp_perfbuild_$b/bsq_perftest" \
$args "$test" "$infile" 2>&1 |
fmt -1 |
grep elapsed |
sed 's/elapsed//')
echo -ne "$elapsed\t\t"
done
echo
done

echo

for b in $buildtypes; do
rm -rf "tmp_perfbuild_$b"
done


0 comments on commit 577793e

Please sign in to comment.