'What the performance implications of streaming the exact same collection twice?
I have a Firestore query in my flutter app that returns a stream.
static Stream<List<String>> streamData() {
var db = FirebaseFirestore.instance;
var ref = db.collection('myCollection')
.where('someField1', isEqualTo: 'someFixedValue')
.where('someField2', isEqualTo: 'someFixedValue');
return ref.snapshots().map((list) => list.docs.map((doc) => doc['myStringField'] as String).toList());
}
Since this query does not change at all, what are the performance implications if I call it multiple times throughout my app and potentially have multiple view models holding independent instances of this stream?
Will Firestore be smart enough to know to only stream this data over the wire once? Could I call this 20 times without significant concern about network usage and memory usage on the client?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
