gabriel / musehub public
perf BREAKING perf/mwp-bulk-inserts #1 / 1
gabriel · 170 days ago · Apr 10, 2026 · Diff

perf: MWP bulk inserts, N+1 fix, parallel presign, stale snapshot repair

- bulk_upsert_snapshot_entries: ON CONFLICT DO UPDATE WHERE manifest_blob IS NULL (repairs stale rows; was DO NOTHING which silently dropped manifests) - wire_push commits: single pg_insert ON CONFLICT DO NOTHING replaces N session.add() calls - wire_fetch: get_snapshot_manifests_batch eliminates N+1 manifest queries - wire_presign: asyncio.gather parallelises presign loop - transport.py: CHUNK_COMMITS 200 → 500 (fewer sequential round-trips) - musehub/models/musehub.py: add missing StrDict import (fixes Pydantic model resolution) - tests/test_snapshot_entries.py: update 7 tests to assert on manifest_blob path (not legacy musehub_snapshot_entries table); rewrite update test as backfill test

sha256:8bb07e6fbcf39f8cb56726ab86e89eb7aff70ed1c6712dbabb32352a261c2744 sha
+5 ~11 −2 symbols
sha256:2b60f17789c95bbdd8a6dbe14e4fca9e45d29609c6f9146a9d0428e75f155dcd snapshot
+5
symbols added
~11
symbols modified
−2
symbols removed
0
dead code introduced
Semantic Changes 18 symbols
~ musehub/models/musehub.py .py 1 symbol added, 1 symbol modified
+ StrDict import import StrDict L15–15
~ musehub/services/musehub_snapshot.py .py 1 symbol added, 1 symbol modified
+ pg_insert import import pg_insert L34–34
~ musehub/services/musehub_wire.py .py 2 symbols added, 3 symbols modified
+ asyncio import import asyncio L22–22
+ pg_insert import import pg_insert L29–29
~ tests/test_snapshot_entries.py .py 1 symbol added, 2 symbols removed, 6 symbols modified
− _get_entries function async_function _get_entries L130–139
− test_upsert_snapshot_entries_updates_changed_object_id function async_function test_upsert_snapshot_entries_updates_changed_object_id L236–256
+ test_upsert_snapshot_entries_backfills_null_blob function async_function test_upsert_snapshot_entries_backfills_null_blob L225–250
← Older Oldest on perf/mwp-bulk-inserts
All commits
Newer → Latest on perf/mwp-bulk-inserts

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:8bb07e6fbcf39f8cb56726ab86e89eb7aff70ed1c6712dbabb32352a261c2744 --body "your comment"