simpler, more compatible benchmarking script
This commit is contained in:
parent
a52ed959b1
commit
0fb03d35dc
2 changed files with 12 additions and 19 deletions
2
Makefile
2
Makefile
|
@ -56,9 +56,11 @@ install: all
|
||||||
install -d ${LADSPADEST}
|
install -d ${LADSPADEST}
|
||||||
install -m 644 ${SHOBJ} ${LADSPADEST}
|
install -m 644 ${SHOBJ} ${LADSPADEST}
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
-rm -f ${ALL} bench ${BENCH}
|
-rm -f ${ALL} bench ${BENCH}
|
||||||
|
|
||||||
|
.PHONY: dist
|
||||||
dist:
|
dist:
|
||||||
-rm -f ${FULLNAME}.tar.gz
|
-rm -f ${FULLNAME}.tar.gz
|
||||||
mkdir -p ${FULLNAME}
|
mkdir -p ${FULLNAME}
|
||||||
|
|
29
bench.sh
29
bench.sh
|
@ -1,19 +1,10 @@
|
||||||
#!/bin/zsh
|
#!/bin/bash
|
||||||
local bench="$1"
|
bench="$1"
|
||||||
local against="$2"
|
against="$2"
|
||||||
local i x n=0 t m=9999
|
|
||||||
finish() {
|
TIMEFORMAT='%3R'
|
||||||
[ $n -gt 0 ] && printf "\nmin %.3f avg %.3f total %.3f\n" $m $((x/n)) $x
|
for i in {1..8}; do
|
||||||
exit 0
|
time "$bench" "$against"
|
||||||
}
|
done 2>&1 >/dev/null | awk 'BEGIN{m=999;printf " …\033[90m"}
|
||||||
trap finish INT
|
{a+=$1;n++;m=$1<m?$1:m;printf " %6.3f",$1}
|
||||||
echo -n "…"
|
END{printf "\033[0m\nmin %6.3f — avg %6.3f — total %7.3f\n",m,a/n,a}'
|
||||||
for ((i=0; i<8; i++)); do
|
|
||||||
sleep 0.5
|
|
||||||
t="$(TIMEFMT='%*E'$'\n'; (time "$bench" "$against") 2>&1)"
|
|
||||||
echo -n " ${t}"
|
|
||||||
let 'x += t'
|
|
||||||
let 'n += 1'
|
|
||||||
[[ $t < $m ]] && m=$t
|
|
||||||
done
|
|
||||||
finish
|
|
||||||
|
|
Loading…
Reference in a new issue