Files
bitvid/CONTEXT.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

1.2 KiB

Context

Goal

Improve app responsiveness by identifying and remediating background CPU/network work that degrades UX, while ensuring user-facing docs (/content) reflect the actual runtime behavior of upload/contribution flows.

Scope

  • Repository: PR0M3TH3AN/bitvid (unstable branch)
  • Focus Areas:
    • P0: Login/auth, relay initialization & profile hydration, decryption of user lists.
    • P1: Initial UI responsiveness (profile cache, relay load).
    • P2: Background features (WebTorrent).
    • Docs: /content (upload/contribution flows).

Assumptions

  • The codebase uses vanilla JS/ES modules.
  • js/utils/logger.js is the standard logging mechanism.
  • js/constants.js contains feature flags.
  • config/instance-config.js contains instance-specific config.

Constraints

  • Never invent files, APIs, libraries, or behaviors.
  • Prefer minimal incremental changes.
  • Keep build/tests green.
  • Security-critical changes require human signoff.

Definition of Done

  • Performance improvements are verified with metrics or manual tests.
  • Documentation updates are verified against code and runtime behavior.
  • PRs include CONTEXT.md, TODO.md, DECISIONS.md, TEST_LOG.md.