perf: fast relay reads, eliminate blocking queries#59
Merged
Conversation
- NostrProvider: read from 3 fast relays only (damus, primal, nos.lol ~200ms) but publish to all 6 for broad distribution. NPool.query() waits for ALL relays to EOSE, so slow/unresponsive relays (nostr.band, ditto, wine) were blocking every query for 5-8s. - useLatestEpisode: removed fetchLivestreamStarts — single relay query now instead of two sequential. created_at is sufficient for finding latest. - useInfiniteEpisodes: removed fetchLivestreamStarts — episodes render immediately instead of waiting for a second relay roundtrip.
kurt-croix
force-pushed
the
fix/fast-relay-queries
branch
from
May 12, 2026 14:35
c2702d5 to
007ed5e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Homepage latest episode took 8s to load. Episodes page rendered all at once.
Root Cause
useLatestEpisodeanduseInfiniteEpisodesmade TWO sequential relay queries (episodes → livestream starts), doubling latency.Changes
fetchLivestreamStarts— single query instead of two sequential.created_atis sufficient for determining latest episode.fetchLivestreamStarts— episodes render immediately instead of waiting for second relay roundtrip.Result