Cache performance debugging

Hey all - Following up in this forum after speaking in person with some members of your team last week.

We were wondering if there was any general advice for how to debug or instrument the Apollo Client cache performance bottlenecks.

We have a use case where we query for large lists of entities, and have noticed pretty significant differences in how fast the query is able to resolve when we switch between ‘network-only’ fetch policy vs ‘no-cache’.

This leads us to believe that cache writes have a certain amount of performance overhead, but aren’t able to definitively confirm which aspect of the apollo caching internals contributes to it (i.e. cache diffing, observability overhead, AST traversals, or possibly other factors etc.)

Are there any recommended levers/knobs for performance tuning or diagnostics on the Apollo client internals?

Hi @daronimo, which version of Apollo Client are you referring to? Is this for React/React Native (typescript apollo-client), iOS (apollo-ios), or Android (apollo-kotlin)?

We’re using the typescript client for React Native, version 3.11.

@jerelmiller @lenz Any input on this one?