-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Optimistic updates slow? #1225
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
Comments
@scottmas it might be unrelated but could you try out the performance/threading changes I've pushed up for Cloud Firestore, see my comment: #1223 (comment) It might be down to the above block thread issue delaying reads. I am assuming of course you meant Android as you've not mentioned any platforms or versions 😛 Loving
|
I will try that out! However, the 150ms-200ms lag actually occurs on both ios and android. This is with a query that contains only 1 docChange, so it's highly unlikely to be the async issue you describe. |
@scottmas inclined to agree with you as well in that case. Lets start with iOS; what version of the Firestore pod are you running? There was a recent change on the ios-sdk that should have improved the performance of document querying on a collection; firebase/firebase-ios-sdk#1533 - I believe this landed in v5.4.1 of the Firestore ios pod. The change was also ported to the official JS SDK (firebase/firebase-js-sdk#1055) - unsure on Android as it's closed source. |
Closing due to inactivity - please comment with a response to the above and we'll reopen. |
I'm seeing the same thing (slow optimistic updates), and have seen it across a few projects / firebase versions. Is this a native firebase thing that can't be fixed? Thanks |
Search the threads in the upstream repos - the firebase team is very responsive to queries there, especially if you can knock together a tiny reproduction repo |
Optimistic updates do not seem to work as fast expected in Firestore. It takes at minimum 200 ms for a snapshot listener to be triggered after the db is written to. I have offline persistence enabled for what that's worth, but the behavior is the same with or without internet connectivity.
Is there anything I am doing wrong or could do differently? I love the pattern of subscribing to snapshots from the data store and rendering the UI directly from it, then writing directly to the datastore and having my UI instantly update via the optimistic propagation. But the 200 ms lag makes this pattern problematic, so I may just have to have an intermediate caching layer, which I REALLY would like to avoid.
The text was updated successfully, but these errors were encountered: