Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Performance issues related to complete_value on large datasets

オープン
#189 コメント 3 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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}
}

image

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 はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphql-python/graphql-core のほかの issue

graphql-python/graphql-core の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。