Performance issues related to complete_value on large datasets
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- api, performance
調査の方向性
execute.py の ExecutionContext.complete_value、complete_list_value、complete_object_value から始め、報告された graphql.py の呼び出しパスを再現のエントリーポイントとして使用します。Python 3.8 と graphql-core 3.2.3 で 5,000 要素のネストされたクエリを再現し、実行をプロファイルして、変更によって返される結果を変えずにオーバーヘッドが削減されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 531
- フォーク
- 147
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphql-python/graphql-core のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
graphql-python/graphql-core#272 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
graphql-python/graphql-core#269 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
graphql-python/graphql-core#267 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
graphql-python/graphql-core#257 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
graphql-python/graphql-core#247 · コメント 8 件 ·
graphql-python/graphql-core の issue をすべて見る
似ている issue
-
essnmx good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
[Feature] 奇物选择添加优先级 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
syfoud/Simulated_Scepter#174 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Giskard-AI/giskard-oss#2840 · コメント 1 件 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success オープンarea: repo bug perceived difficulty: 2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
yeti-platform/yeti#1380 ·