Page MenuHomePhabricator
Paste P96624

Measure TTS v1 batch generation times
ActivePublic

Authored by kevinbazira on Oct 8 2026, 6:25 AM.
Project Tags
None
Referenced Files
F106969868: Measure TTS v1 batch generation times
Oct 8 2026, 6:25 AM
Subscribers
None
$ python3 - <<'EOF'
import json, statistics
rows = []
for path in ("batch_generation.jsonl", "backfill3.jsonl"):
try:
for line in open(path, encoding="utf-8"):
r = json.loads(line)
if r.get("status") == "ok" and r.get("wall_s"):
rows.append((r["wall_s"], r.get("duration_ms", 0) / 1000, r.get("title")))
except FileNotFoundError:
pass
w = sorted(x[0] for x in rows)
print(f"{len(w)} sections generated\n")
def pct(p): return w[min(int(len(w) * p / 100), len(w) - 1)]
for p in (50, 75, 90, 95, 99):
print(f" p{p:<3} {pct(p):6.1f} s")
print(f" mean {statistics.mean(w):6.1f} s max {w[-1]:6.1f} s min {w[0]:5.1f} s")
# does generation time track audio length? (the ratio web will care about)
ratios = [g / a for g, a, _ in rows if a > 1]
print(f"\n generation time per second of audio: median {statistics.median(ratios):.2f}x")
print(f" audio length: median {statistics.median([a for _, a, _ in rows]):.0f} s")
print("\n slowest five:")
for g, a, t in sorted(rows, reverse=True)[:5]:
print(f" {g:6.1f} s for {a:5.0f} s of audio {t}")
EOF
7763 sections generated
p50 69.2 s
p75 89.4 s
p90 109.8 s
p95 121.0 s
p99 143.8 s
mean 72.6 s max 210.8 s min 17.1 s
generation time per second of audio: median 1.02x
audio length: median 67 s
slowest five:
210.8 s for 348 s of audio Philosophy of logic
201.5 s for 203 s of audio Des Corcoran
185.9 s for 202 s of audio Antinomian Controversy
185.8 s for 331 s of audio Spanish conquest of Yucatán
182.5 s for 116 s of audio George Wythe