36 lines
1.5 KiB
Bash
36 lines
1.5 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 sweep
|
|
taskkill //F //IM btl4.exe >/dev/null 2>&1; sleep 2
|
|
rm -f gs_${1}.log
|
|
bt_expert_egg MP.EGG GS.EGG
|
|
sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" GS.EGG
|
|
( export BT_GLASS_PANELS=1 BT_PLATFORM=glass BT_GLASS_SWEEP=${2}
|
|
export BT_AUTODRIVE=0.6 BT_BTNTEST=0x42,900,1150 BT_KEY_NOFOCUS=1
|
|
bt_launch gs_${1}.log GS.EGG 0x03 )
|
|
sleep 150
|
|
bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe >/dev/null 2>&1; sleep 2
|
|
}
|
|
run gated 0
|
|
run legacy 1
|
|
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\gs_%s.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
|