Skip to content

[web] debounce update notifications #266

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

Merged
merged 3 commits into from
Aug 14, 2024
Merged

[web] debounce update notifications #266

merged 3 commits into from
Aug 14, 2024

Conversation

rkistner
Copy link
Contributor

Firing update notifications for each individual row adds a massive performance overhead.

This change debounces the notifications, only sending a single event per table changed (we never exposed the row ids of changes to the end-user API anyway).

In some test scenarios this gives a 20-25x speedup in initial sync times, for example going from 240s -> 10s for 40k operations.

Copy link

changeset-bot bot commented Aug 13, 2024

🦋 Changeset detected

Latest commit: 2db0e8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@powersync/web Patch
@powersync/diagnostics-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach looks good to me. I can't think of anything this might break. It's an amazing performance increase.

@rkistner rkistner marked this pull request as ready for review August 14, 2024 14:35
@rkistner rkistner merged commit f2ebd02 into main Aug 14, 2024
4 checks passed
@rkistner rkistner deleted the fix-web-performance branch August 14, 2024 14:36
@rkistner rkistner self-assigned this Aug 14, 2024
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