init
This commit is contained in:
commit
276d43613d
1687 changed files with 109059 additions and 0 deletions
46
benchmarks/summarize.py
Executable file
46
benchmarks/summarize.py
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Summarize benchmarks/results/*.json into a Markdown table (stdout)."""
|
||||
import glob
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
BUDGET_MS = 16.667
|
||||
ORDER = [
|
||||
"normal25_compact_spread", "normal50_compact_spread", "stress250_compact_spread",
|
||||
"stress500_compact_spread", "stress1000_enlarged_spread", "stress2000_enlarged_spread",
|
||||
"stress2000_enlarged_concentrated", "stress2000_enlarged_bottleneck",
|
||||
"stress1000_compact_concentrated", "stress2000_compact_concentrated",
|
||||
"stress1000_compact_bottleneck", "vsync_normal50_compact_spread",
|
||||
"vsync_stress2000_enlarged_spread",
|
||||
]
|
||||
|
||||
|
||||
def main() -> None:
|
||||
root = os.path.join(os.path.dirname(__file__), "results")
|
||||
files = {os.path.basename(f)[:-5]: f for f in glob.glob(os.path.join(root, "*.json"))}
|
||||
labels = [l for l in ORDER if l in files] + sorted(l for l in files if l not in ORDER)
|
||||
if not labels:
|
||||
sys.exit("no results")
|
||||
print("| run | birds | layout | vsync | frames | mean ms | p95 ms | p99 ms | max ms | >16.7 ms | "
|
||||
"sim p95 ms | GPU p95 ms | draw calls | p95 <= 16.67 |")
|
||||
print("|---|---|---|---|---|---|---|---|---|---|---|---|---|---|")
|
||||
for label in labels:
|
||||
d = json.load(open(files[label]))
|
||||
f = d["frame_ms"]
|
||||
print(f"| {label} | {d['config']['enemy_count']} | {d['layout']} | {d['display']['vsync']} | "
|
||||
f"{f['count']} | {f['mean']:.2f} | {f['p95']:.2f} | {f['p99']:.2f} | {f['max']:.2f} | "
|
||||
f"{d['frames_over_16_67ms']} | {d['sim_tick_ms']['p95']:.2f} | {d['gpu_render_ms']['p95']:.2f} | "
|
||||
f"{d['draw_calls_mean']:.0f} | {'PASS' if f['p95'] <= BUDGET_MS else 'FAIL'} |")
|
||||
d = json.load(open(files[labels[0]]))
|
||||
hw, eng, disp = d["hardware"], d["engine"], d["display"]
|
||||
print()
|
||||
print(f"CPU: {hw['cpu']} ({hw['cpu_threads']} threads); GPU: {hw['gpu']} ({hw['graphics_api_version']}); "
|
||||
f"OS: {hw['os']}; display server: {hw['display_server']}")
|
||||
print(f"Engine: {eng['version']}; renderer: {eng['renderer']}; debug build: {eng['debug_build']}; "
|
||||
f"{eng['build_note']}; MSAA 3D setting: {eng['msaa_3d']}")
|
||||
print(f"Window: {disp['window']} (viewport {disp['viewport']}), refresh {disp['refresh_hz']:.0f} Hz")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue