After upgrading firestore dependency 21.4.3 -> 21.5.0
Firestore document fetch times became waaaayy longer.
ex: in my project, we have documents with a 3 element array, and depending on which element was changed, the fetch time increases
array 0 element was changed, document is fetched in 0.8sec
array 1 element was changed, document is fetched in 20 sec
array 2 element was changed, document is fetched in 35 sec
At least this is the behavior I see on my main projects development environment, on the production environment it only takes 5~7 seconds, not sure why...
This document is only changed by the back end.
If persistence is disabled, all fetch times become almost instant
Made a mock project to reproduce a similar issue. the database is updated from the client, but we can still see long delays.
Note: if I switch dependency to 21.4.3 or turn persistence off everything works super smooth
each new volume increases load time by ~5.5 sec
doing a data fetch without changing anything in the database, return the data instantly.
if any of the volume data is updated by using firestore console, depending on the volume position(array index) fetch time increases.
example:
volume 0 : 0 sec
volume2 : 1 sec
volume4 : 2 sec
volume8 : 4 sec
@AurimasSikorskas Thanks for taking the time to create a repro! I was able to reproduce this locally and observe the behavior you described. I'm going to dig into this some more, and report back once I understand what's happening.
Quick follow up: the slow load times are due to our recent upgrade to the protolite library in #1534. We are currently using the Protobuf equality checker, which is the root cause of the delay. When I tested your repro app with a custom build that used Firestore's equality checker, the update speeds returned to their 21.4.3 times. I'll work on getting a fix out in the coming week, which should hopefully allow you to upgrade without such a drastic performance regression.
Also, thanks so much for taking the time to provide such an easy-to-use repro app and description! I found it very helpful when debugging the issue and trying to find a fix.
Most helpful comment
Quick follow up: the slow load times are due to our recent upgrade to the
protolitelibrary in #1534. We are currently using the Protobuf equality checker, which is the root cause of the delay. When I tested your repro app with a custom build that used Firestore's equality checker, the update speeds returned to their 21.4.3 times. I'll work on getting a fix out in the coming week, which should hopefully allow you to upgrade without such a drastic performance regression.Also, thanks so much for taking the time to provide such an easy-to-use repro app and description! I found it very helpful when debugging the issue and trying to find a fix.