gabriel / muse public
perf patch dev
AI Agent gabriel · 120 days ago · May 10, 2026 · Diff

perf: concurrent presigned PUTs with semaphore-bounded asyncio.gather

Replace sequential for-loop PUT with asyncio.gather + Semaphore(64). Add _make_r2_client() with keepalive enabled and _run_presign_puts() as a testable unit. TDD: 5 concurrency tests cover timing, keepalive, semaphore cap, completeness, and error propagation.

sha256:36432699cdada4376d8ed47d0d071d76ff0e12c58e0c415d19447562c558bda0 sha
+20 ~1 symbols
sha256:d231e10c1748725abd0e0dd81b4573058a463f3e86de530c86453a733c3f0ad1 snapshot
+20
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 21 symbols
+ _make_obj_map function function _make_obj_map L38–42
+ _make_url_map function function _make_url_map L34–35
+ AsyncMock import import AsyncMock L19–19
+ MagicMock import import MagicMock L19–19
+ PRESIGN_PUT_CONCURRENCY import import PRESIGN_PUT_CONCURRENCY L23–23
+ _run_presign_puts import import _run_presign_puts L23–23
+ annotations import import annotations L15–15
+ asyncio import import asyncio L17–17
+ long_id import import long_id L27–27
+ patch import import patch L19–19
+ pytest import import pytest L21–21
+ time import import time L18–18
+ test_c1_puts_are_concurrent function async_function test_c1_puts_are_concurrent L49–75
+ test_c2_keepalive_not_disabled function function test_c2_keepalive_not_disabled L82–103
+ test_c3_semaphore_caps_concurrency function async_function test_c3_semaphore_caps_concurrency L110–138
+ test_c4_all_objects_uploaded function async_function test_c4_all_objects_uploaded L145–165
+ test_c5_http_error_raises_transport_error function async_function test_c5_http_error_raises_transport_error L172–193
~ muse/cli/commands/push.py .py 3 symbols added, 1 symbol modified
+ PRESIGN_PUT_CONCURRENCY variable variable PRESIGN_PUT_CONCURRENCY L120–120
+ _make_r2_client function function _make_r2_client L122–131
+ _run_presign_puts function async_function _run_presign_puts L133–154
← 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:36432699cdada4376d8ed47d0d071d76ff0e12c58e0c415d19447562c558bda0 --body "your comment"