Commit Graph
3 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 004c0bed83 fix(ci): reduce channelProfile.js size and bound relay concurrency
- Refactored `js/channelProfile.js` to use `pMapSettled` from `js/utils/asyncUtils.js`, fixing both the concurrency issue (P1) and the file size lint failure.
- `pMapSettled` replaces a bulky inline `pMap` wrapper, reducing code volume.
- Ensures `js/channelProfile.js` stays within its grandfathered line count limit (5579 lines).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 10:55:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6a74b3ddfc Refactor fetchListIncrementally into RelayBatchFetcher and genericize timeout logic
Extracted `fetchListIncrementally` from `js/nostr/client.js` into a new `RelayBatchFetcher` class in `js/nostr/relayBatchFetcher.js` to reduce complexity in `NostrClient`.
Moved `withRequestTimeout` to `js/utils/asyncUtils.js` to make it reusable and remove duplication.
Updated `js/nostr/client.js` to use these new components while preserving existing behavior and specific logging for COUNT diagnostics.

- Created `js/nostr/relayBatchFetcher.js`
- Updated `js/utils/asyncUtils.js`
- Refactored `js/nostr/client.js`
- Verified with existing tests

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 19:09:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN ab441ce0c4 ⚡ Optimize watch history publishing with parallel execution
- Implemented `pMap` utility for concurrent async mapping with a limit.
- Refactored `publishRecords` in `js/nostr/watchHistory.js` to use `pMap` instead of serial `for...of` loop.
- Added `tests/benchmark_watch_history_publish.mjs` to verify performance.

Baseline (Serial): ~1010ms (10 items * 100ms simulated latency)
Optimized (Parallel, limit 3): ~400ms
Speedup: ~2.5x faster.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:38:13 +00:00