Performance issues related to complete_value on large datasets
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- api, performance
Direzione di ricerca
Inizia in execute.py, in ExecutionContext.complete_value, complete_list_value e complete_object_value, usando il percorso di chiamata graphql.py segnalato come punto di ingresso per la riproduzione. Riproduci la query annidata di 5.000 elementi su Python 3.8 con graphql-core 3.2.3, profila l'esecuzione e verifica che qualsiasi modifica riduca l'overhead senza alterare il risultato restituito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi! We've noticed that returning a list of 5k elements, with a couple of nested objects is pretty slow:
Person {
id
name
lastname
age
address {street number}
job {id org_name}
partner {id name}
pets {name type}
school {id name}
}

| ncalls | tottime | percall | cumtime | percall | filename:lineno(function) |
|---|---|---|---|---|---|
| 1 | 1.8e-05 | 1.8e-05 | 2.145 | 2.145 | graphql.py:103(graphql_sync) |
| 1 | 1.5e-05 | 1.5e-05 | 2.145 | 2.145 | graphql.py:152(graphql_impl) |
| 1/30001 | 0.19 | 6.335e-06 | 2.137 | 7.122e-05 | execute.py:413(ExecutionContext.execute_fields) |
| 1 | 1.3e-05 | 1.3e-05 | 2.137 | 2.137 | execute.py:965(execute) |
| 1 | 7e-06 | 7e-06 | 2.137 | 2.137 | execute.py:328(ExecutionContext.execute_operation) |
| 1/135001 | 0.3229 | 2.392e-06 | 2.135 | 1.581e-05 | execute.py:485(ExecutionContext.execute_field) |
| 1/145001 | 0.2737 | 1.888e-06 | 2.071 | 1.428e-05 | execute.py:575(ExecutionContext.complete_value) |
| 1 | 0.009884 | 0.009884 | 2.071 | 2.071 | execute.py:660(ExecutionContext.complete_list_value) |
| 5000/30000 | 0.02747 | 9.156e-07 | 2.026 | 6.752e-05 | execute.py:893(ExecutionContext.complete_object_value) |
By itself it's not really a slow function, but its executed 30k times. Is there any way to reduce the overhead by reducing the number of times this function is invoked?
Tested on Python 3.8 and graphql-core==3.2.3
- Lingua principale
- Python
- Stelle
- 531
- Fork
- 147
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di graphql-python/graphql-core
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
graphql-python/graphql-core#272 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
graphql-python/graphql-core#269 · 1 commento ·
-
Publish a major version Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
graphql-python/graphql-core#267 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
graphql-python/graphql-core#257 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
graphql-python/graphql-core#247 · 8 commenti ·
Tutte le issue di graphql-python/graphql-core
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/skills#1811 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
speaches-ai/speaches#678 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
datalayer/mcp-compose#42 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
UKGovernmentBEIS/inspect_evals#2523 ·