Files
bitvid/DECISIONS.md
T
google-labs-jules[bot]andPR0M3TH3AN d3fa684e45 perf: bound relay background concurrency to 3
Replaces unbounded `Promise.all(relays.map(...))` calls with `pMap` using a concurrency limit of 3 for background operations like history hydration, metadata fetching, and DM sending.
This prevents network saturation and potential main-thread jank when many relays are configured.
Includes benchmark verification script `benchmarks/relay_concurrency_repro.mjs`.
Audited upload docs and confirmed accuracy.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 21:31:53 +00:00

8 lines
484 B
Markdown

# Decisions
## Log
- **Bound Relay Concurrency**: Decided to use `pMap` with `RELAY_BACKGROUND_CONCURRENCY = 3` to limit concurrent relay requests during background tasks (history hydration, metadata fetch, DM send).
- *Rationale*: Unbounded `Promise.all` causes network congestion and can freeze the UI if many relays are configured. 3 is a conservative default.
- *Alternative*: Could have used a global queue, but per-operation concurrency is simpler and sufficient for now.