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

Performance improvements #102

Merged
merged 2 commits into from
Jun 7, 2022
Merged

Performance improvements #102

merged 2 commits into from
Jun 7, 2022

Conversation

jonatanklosko
Copy link
Member

Entering results suffers from large delays. After some investigation I found out that the time grows significantly with the number of connected clients. I identified two independent issues in the packages we use:

  1. (primary cause) When a result is entered we send a GraphQL subscription update to all subscribers. The relevant data should be computed once and sent once to each client. What happens in practice is that assuming N clients we would compute and send the update to everyone N times! That's a regression in absinthe 1.5.5 -> 1.6.0, see Multiple pushes per client for subscriptions that have a context_id absinthe-graphql/absinthe#1064. I downgraded to 1.5.5 for now.

  2. Currently, after getting the result update, each client would go and unnecessarily refetch all round data again. That's an issue in @apollo/client and it's been resolved in 3.6.0 (Fix defaultOptions.watchQuery.fetchPolicy not being used by useQuery apollographql/apollo-client#9210), so bumping the version helped.

@jonatanklosko jonatanklosko merged commit d5a661a into master Jun 7, 2022
@jonatanklosko jonatanklosko deleted the jk-performance branch June 7, 2022 21:56
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.

1 participant