Skip to content
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

Submit your ApolloClient.getMemoryInternals values here! #11444

Closed
phryneas opened this issue Dec 20, 2023 · 5 comments
Closed

Submit your ApolloClient.getMemoryInternals values here! #11444

phryneas opened this issue Dec 20, 2023 · 5 comments

Comments

@phryneas
Copy link
Member

phryneas commented Dec 20, 2023

Please try our beta in your application, run our development builds in your dev or staging environments, and after using your app for a while, run __APOLLO_CLIENT__.getMemoryInternals(), and submit the results in a comment here.

The more measurements we get from real-life apps, the better we can choose those default cache sizes!

@phryneas phryneas added this to the MemoryAnalysis milestone Dec 20, 2023
@phryneas
Copy link
Member Author

Adding a first example from our own Spotify Showcase

{
    "limits": {
        "parser": 1000,
        "canonicalStringify": 1000,
        "print": 2000,
        "documentTransform.cache": 2000,
        "queryManager.getDocumentInfo": 2000,
        "PersistedQueryLink.persistedQueryHashes": 2000,
        "fragmentRegistry.transform": 2000,
        "fragmentRegistry.lookup": 1000,
        "fragmentRegistry.findFragmentSpreads": 4000,
        "cache.fragmentQueryDocuments": 1000,
        "removeTypenameFromVariables.getVariableDefinitions": 2000,
        "inMemoryCache.maybeBroadcastWatch": 5000,
        "inMemoryCache.executeSelectionSet": 10000,
        "inMemoryCache.executeSubSelectedArray": 5000
    },
    "sizes": {
        "print": 13,
        "parser": 25,
        "canonicalStringify": 4,
        "links": [],
        "queryManager": {
            "getDocumentInfo": 13,
            "documentTransforms": []
        },
        "cache": {
            "fragmentQueryDocuments": 15
        },
        "addTypenameDocumentTransform": [
            {
                "cache": 13
            }
        ],
        "inMemoryCache": {
            "executeSelectionSet": 3121,
            "executeSubSelectedArray": 824,
            "maybeBroadcastWatch": 138
        },
        "fragmentRegistry": {
            "findFragmentSpreads": 33,
            "lookup": 20,
            "transform": 13
        }
    }
}

@phryneas phryneas pinned this issue Dec 21, 2023
@jerelmiller
Copy link
Member

Here are the limits for a sm-med side project I have (~20-30 routes with 50+ entity types in my schema). It looks like I hit the limits on "inMemoryCache.executeSelectionSet" and "inMemoryCache.executeSubSelectedArray", but everything else has lots of room to grow.

{
    "limits": {
        "parser": 1000,
        "canonicalStringify": 1000,
        "print": 2000,
        "documentTransform.cache": 2000,
        "queryManager.getDocumentInfo": 2000,
        "PersistedQueryLink.persistedQueryHashes": 2000,
        "fragmentRegistry.transform": 2000,
        "fragmentRegistry.lookup": 1000,
        "fragmentRegistry.findFragmentSpreads": 4000,
        "cache.fragmentQueryDocuments": 1000,
        "removeTypenameFromVariables.getVariableDefinitions": 2000,
        "inMemoryCache.maybeBroadcastWatch": 5000,
        "inMemoryCache.executeSelectionSet": 10000,
        "inMemoryCache.executeSubSelectedArray": 5000
    },
    "sizes": {
        "print": 32,
        "parser": 85,
        "canonicalStringify": 6,
        "links": [
            {
                "removeTypenameFromVariables": {
                    "getVariableDefinitions": 0
                }
            }
        ],
        "queryManager": {
            "getDocumentInfo": 35,
            "documentTransforms": []
        },
        "cache": {
            "fragmentQueryDocuments": 3
        },
        "addTypenameDocumentTransform": [
            {
                "cache": 35
            }
        ],
        "inMemoryCache": {
            "executeSelectionSet": 10000,
            "executeSubSelectedArray": 5000,
            "maybeBroadcastWatch": 3
        },
        "fragmentRegistry": {
            "findFragmentSpreads": 45,
            "lookup": 10,
            "transform": 35
        }
    }
}

@phryneas
Copy link
Member Author

phryneas commented Feb 6, 2024

Closing this as 3.9 has been released.

@phryneas phryneas closed this as completed Feb 6, 2024
@phryneas phryneas unpinned this issue Feb 6, 2024
Copy link
Contributor

github-actions bot commented Feb 6, 2024

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.

Copy link
Contributor

github-actions bot commented Mar 9, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants