With watch() + asyncCaching = true, we get two (ignoring cache miss) emissions on the watch flow:
- from network result
- from cache result
The latter has non-trivial latency/overhead to generate, especially with large payloads. Currently we just dedupe repeated emissions of the same data, but that still has the overhead of:
- reading from the cache and generating the apollo response
- the cost of .equals comparing the old and new to dedupe
- this might be another request: possibly consider memoizing the hashcodes of each data object (they're imutable, so this should be safe) to avoid needing to do very deep hashcode traversals over hundreds or thousands of nodes.
This is a request to instead not even try to generate that second emission on the original flow (you still need to trigger other watchers) if the data didn't change.
This is especially important in case where you're driving UI with the data, since that second emission:
- competes with the resources needed to render/update the ui
- might cause (limited) recomposition in things like compose
With watch() + asyncCaching = true, we get two (ignoring cache miss) emissions on the watch flow:
The latter has non-trivial latency/overhead to generate, especially with large payloads. Currently we just dedupe repeated emissions of the same data, but that still has the overhead of:
This is a request to instead not even try to generate that second emission on the original flow (you still need to trigger other watchers) if the data didn't change.
This is especially important in case where you're driving UI with the data, since that second emission: