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

Fix view db lag #304

Merged
merged 3 commits into from
Jan 26, 2022
Merged

Fix view db lag #304

merged 3 commits into from
Jan 26, 2022

Conversation

mplorentz
Copy link
Member

#284 This changes the parameters for our RefreshOperations, which are the operations we use to copy data from the go-ssb log into SQLite. We were doing very tiny ~1 second refreshes every 17 seconds in the background. And if the user did a pull-to-refresh gesture they could end up waiting 30 seconds for a refresh in the worst case.

These values seemed backwards to me. Maybe the background refreshes were so small because we were worried about background operations affecting the UI thread. But after doing some testing I think this gives a much better experience. Now we spend up to 30 seconds fetching up to 45,000 messages for background refreshes. If the user pulls-to-refresh we pull in up to 15,000 new messages in ~10 seconds. The vast majority of the time these refreshes will happen much more quickly (less than a second). But when you get a ton of new messages the app will now work much harder in the background to get SQLite up to date.

@mplorentz mplorentz merged commit 7c5675a into master Jan 26, 2022
@mplorentz mplorentz deleted the fix-view-db-lag branch January 26, 2022 18:59
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