29 lines
1.3 KiB
Bash
29 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
|
. /c/git/bt411/scratchpad/night6/bench_common.sh
|
|
cd /c/git/bt411/content || exit 1
|
|
for tag in with without; do
|
|
taskkill //F //IM btl4.exe >/dev/null 2>&1; sleep 2
|
|
[ $tag = without ] && sed -i 's/^\(.*bduck\.pcc.*\)$/#BDUCKAB \1/' GAUGE/L4GAUGE.CFG
|
|
rm -f ab_$tag.log
|
|
bt_expert_egg MP.EGG AB.EGG
|
|
sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" AB.EGG
|
|
( export BT_GLASS_PANELS=1 BT_POD_SURFACES=1 BT_AUTODRIVE=0.5 BT_KEY_NOFOCUS=1
|
|
bt_launch ab_$tag.log AB.EGG 0x0F )
|
|
sleep 80
|
|
bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe >/dev/null 2>&1; sleep 2
|
|
sed -i 's/^#BDUCKAB //' GAUGE/L4GAUGE.CFG
|
|
done
|
|
echo RESULT
|
|
python - <<'PY'
|
|
import re,io,statistics
|
|
for tag in ['with','without']:
|
|
rs=[]
|
|
for l in io.open(r"C:\git\bt411\content\ab_%s.log"%tag,encoding='latin-1',errors='replace'):
|
|
m=re.search(r'\[rstat\] frames=\d+ avg=([\d.]+)ms maxDraw=([\d.]+) maxPresent=([\d.]+)',l)
|
|
if m: rs.append((float(m.group(1)),float(m.group(2)),float(m.group(3))))
|
|
if rs:
|
|
print('%-8s n=%d avg-med=%.2f draw-med=%.2f present-med=%.2f'%(tag,len(rs),
|
|
statistics.median([a for a,_,_ in rs]),statistics.median([d for _,d,_ in rs]),statistics.median([p for _,_,p in rs])))
|
|
else: print(tag,'NO RSTAT')
|
|
PY
|