Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(PredictionsPubSub): immediately broadcast resets #1796

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

thecristen
Copy link
Collaborator

Summary of changes

Asana Ticket: Stop page loads predictions and schedules slowly (Predictions)

By adding immediate broadcasting of the :reset events coming from the predictions stream, I was able to decrease the time-to-first-predictions on the Haymarket page in Chrome desktop from 11145 ms to 715 ms (-93.6%). (This was measured using console.time and console.timeEnd on the predictions being output from the usePredictionsChannel hook). Similar decreases were seen at other stops.

My understanding is that reset events are generally the first event after subscribing to a stream, though they can happen at other points during the stream as well. :) So that seemed like a reasonable place to immediately send the predictions to subscribing channels etc.

@thecristen thecristen requested a review from a team as a code owner November 15, 2023 22:32
@thecristen thecristen requested a review from kotva006 November 15, 2023 22:32
@thecristen thecristen merged commit 1ef5817 into master Nov 22, 2023
23 checks passed
@thecristen thecristen deleted the cbj/better-prediction-timing branch November 22, 2023 16:38
thecristen added a commit that referenced this pull request Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants