graphql-python / graphql-python/graphql-core

Slow introspection query execution for large schemas

Offen
#101 6 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
help wanted investigate optimization
Vorherrschende Sprache
Python
Sterne
531
Forks
146
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

The graphql-core `graphql_sync` function takes approximately 20x slower than a module that I wrote that solely executes the introspection query. https://github.com/kensho-technologies/graphql-compiler/blob/main/graphql_compiler/fast_introspection.py

With the graphql-core Python library, executing the default introspection query (outputted from `get_introspection_query`) on a schema of around ten thousand types with `graphql_sync` takes 26 seconds to run. Writing my own module that calls the same graphql-core Type resolvers executes the same query on the same schema in 1.37 seconds.

I'm not sure what exactly is the time sink with the graphql-core's approach, but it might have to do with the generality of `graphql_sync` and thus, computing the next field to resolve at every step, and also `graphql_sync`'s recursive nature. Interestingly, I ran the same query on the same schema using Graphql.js, and the execution took less than 2 seconds (around 1.7 seconds).

Thank you for your time and all the work to port GraphQL.js to Python!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.