Files
bitvid/js
google-labs-jules[bot]andPR0M3TH3AN 5a5772de3a perf: Batch NIP-71 metadata fetches in NostrClient
Currently, when the NostrClient processes a burst of video events (e.g., initial
feed load), it triggers an individual NIP-71 metadata fetch for every video that
updates the `activeMap`. This results in a stampede of network requests (N videos
* M relays).

This change optimizes `flushEventBuffer` to collect all videos requiring metadata
updates and executes a single batched `populateNip71MetadataForVideos` call at
the end of the flush cycle.

This reduces the metadata fetch overhead from O(N) to O(1) per batch.

Verified with a local benchmark script (reduced fetch calls from 50 to 1 for 50 events)
and existing unit tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 19:36:08 +00:00
..
2026-01-30 16:51:01 -05:00
2026-01-30 16:51:01 -05:00
2026-01-30 16:51:01 -05:00
2026-01-24 20:00:00 -05:00
2026-01-23 02:09:08 -05:00
2026-01-26 21:49:18 -05:00
2026-01-30 16:51:01 -05:00
2026-01-27 08:36:12 -05:00