Skip to content

Batch writes blocks rendering #2545

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

Closed
antoniozzo opened this issue Jan 15, 2020 · 1 comment
Closed

Batch writes blocks rendering #2545

antoniozzo opened this issue Jan 15, 2020 · 1 comment
Assignees

Comments

@antoniozzo
Copy link

Describe your environment

  • Operating System version: macOS 10.14.6
  • Browser version: Chrome 79.0.3945.117
  • Firebase SDK version: 7.6.2
  • Firebase Product: firestore

Describe the problem

When I'm updating a few hundred documents with batches, rendering is blocked while firestore is sending the changed documents back through the WebChannel. Having firebase.firestore.setLogLevel("debug") on I can see that I get a bunch of messages, one for each document change: [Connection]: WebChannel received: {"documentChange": .... While these messages are received the rendering of my application is blocked.

Using snapshot.docChanges() I have already got the documents and rendered the changes, but the lag happens after that, while the server is responding with pending writes.

@thebrianchen
Copy link

@antoniozzo Thanks for filing an issue! We're currently working on improving the performance of Firestore. While Firestore is processing the documents, the rendering of your application will unfortunately be blocked. However, if you update your documents in smaller batches, there will be gaps in between batches for you to render, even though the total amount of processing time required by Firestore is still the same.

Another option is to offload Firestore onto a web worker, which will free up your main thread while Firestore is processing documents received over WebChannel. The caveat is that persistence currently does not work when Firestore is run on web workers (though we currently have an experimental build trying to test that out).

@firebase firebase locked and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants