43 lines
1.9 KiB
Bash
43 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
|
. /c/git/bt411/scratchpad/night6/bench_common.sh
|
|
cd /c/git/bt411/content || exit 1
|
|
run () { # $1 tag $2 sweepenv $3 portA $4 portB
|
|
taskkill //F //IM btl4.exe >/dev/null 2>&1; sleep 2
|
|
rm -f gv_${1}_a.log gv_${1}_b.log gv_${1}_r.log
|
|
bt_expert_egg MP.EGG GV.EGG
|
|
sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" GV.EGG
|
|
( export BT_GOTO=enemy BT_GOTO_STOP=150 BT_MP_LOG=1
|
|
bt_launch gv_${1}_b.log GV.EGG 0x0C -net ${4} )
|
|
sleep 2
|
|
( export BT_GOTO=enemy BT_GOTO_STOP=150 BT_MP_LOG=1
|
|
export BT_GLASS_PANELS=1 BT_PLATFORM=glass BT_GLASS_SWEEP=${2}
|
|
export BT_BTNTEST=0x42,900,1150
|
|
bt_launch gv_${1}_a.log GV.EGG 0x03 -net ${3} )
|
|
sleep 5
|
|
python ../tools/btconsole.py GV.EGG 127.0.0.1:${3} 127.0.0.1:${4} > gv_${1}_r.log 2>&1 &
|
|
R=$!; sleep 170; kill $R 2>/dev/null; sleep 2
|
|
bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe >/dev/null 2>&1; sleep 2
|
|
}
|
|
run gated 0 1501 1601
|
|
run legacy 1 1701 1801
|
|
echo RESULT
|
|
python - <<'PY'
|
|
import re, io, statistics
|
|
for tag in ['gated','legacy']:
|
|
gp=[]
|
|
per={}
|
|
for l in io.open(r"C:\git\bt411\content\gv_%s_a.log"%tag, encoding="latin-1", errors="replace"):
|
|
m=re.search(r"\[glassperf\] ticks=(\d+) tickMs=([\d.]+) skip=(\d+)(.*)",l)
|
|
if m:
|
|
gp.append((float(m.group(2)),int(m.group(3))))
|
|
for w,n,ms in re.findall(r"\| ([\w /]+) n=(\d+) ms=([\d.]+)", m.group(4)):
|
|
per.setdefault(w.strip(),[0,0.0]); per[w.strip()][0]+=int(n); per[w.strip()][1]+=float(ms)
|
|
if gp:
|
|
tms=[t for t,_ in gp]; sk=[s for _,s in gp]
|
|
print("%-7s windows=%d tickMs med=%6.1f worst=%6.1f skip med=%d" %
|
|
(tag,len(gp),statistics.median(tms),max(tms),statistics.median(sk)))
|
|
for w,(n,ms) in sorted(per.items(), key=lambda kv:-kv[1][1])[:7]:
|
|
print(" %-18s paints=%-5d ms=%.1f" % (w,n,ms))
|
|
else: print(tag,"NO GLASSPERF")
|
|
PY
|