gabriel / musehub public
dev
AI Agent gabriel · 30 days ago · May 12, 2026 · Diff

bench: add bench_wire.py — MuseWire protocol benchmark for all four verbs

Unified benchmark covering Push / Pull / Fetch / Clone across both transport paths (stream and presign) and the full size matrix (XS → XL).

Key design choices: - Fresh repo per run via create_repo() factory — no state leakage between runs - Pull is incremental: seed half the commits, push the other half, time the delta - Clone and Fetch are identical at the wire level (have=[]) but labelled separately - Two HTTP clients per run: ASGITransport for app endpoints, real httpx for MinIO presigned URLs - FETCH_PRESIGN_OBJECT_THRESHOLD and FETCH_PRESIGN_SIZE_THRESHOLD patched to 0 (force presign) or 999_999 (force stream) via module-level override - Objects prefixed with \x00 to avoid the shebang polyglot-attack check - Gates calibrated against observed local throughput (~2 MB/s MinIO GET, ~1 MB/s stream push, ~90 MB/s presign push)

Baseline results (local MinIO, Apple M-series): XS: all 8 scenarios < 400ms, all gates green S: all 8 scenarios < 420ms, all gates green M: push/stream 2s, presign paths < 1.2s, all gates green L: push/presign 315ms @ 67 MB/s — 60x faster than stream XL: push/presign 1.2s @ 91 MB/s — MinIO GET bottleneck at 2 MB/s for fetches

Usage: python3 tests/bench_wire.py --size xs --verb all --runs 3 python3 tests/bench_wire.py --size m --verb push,fetch --path stream python3 tests/bench_wire.py --size l --path presign --runs 1

sha256:c89da6660d0c4135c290f60a3c82d64d803fc18800255cbd06d3b33978ec851f sha
sha256:8446ecb071eb2a9d3cc26e5fafa7a580c852e72177ceefc0b528c347b2905593 snapshot
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:c89da6660d0c4135c290f60a3c82d64d803fc18800255cbd06d3b33978ec851f --body "your comment"