Reduce LiveKit Over-Subscription and Context Instability in Conference Views
summary
Several conference components (GridView, SpeakerView) suffer from subscription-layer inefficiencies that create a performance bottleneck as participant counts (N) increase. While React Compiler handles basic memoization, it cannot prevent unfiltered event triggers or context reference breaks. These issues lead for example to high CPU overhead or visible video flickering during navigation which degrades the feel of the UX.
Acceptence criteria
-
useParticipants()unfiltered, called in every tile - Replace withuseParticipantContext()from parent provider -
useRemoteParticipantwithoutupdateOnlyOn- AddupdateOnlyOnto track-state events only -
Own
useSortedParticipants(useRemoteParticipants(...))subscription - Remove; receive sorted participants as prop fromSpeakerView -
Own
useSortedParticipants(useRemoteParticipants(...))subscription - Refactor; compute current speaker from lifted sorted list -
Calls both
useCinemaViewParticipantsanduseCurrentSpeaker(two subscriptions) - AcceptparticipantsandcurrentSpeakerIdas props fromSpeakerView