inspect_request on a very large string is extremely slow

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
jupyter, python
領域
api, backend

調査の方向性

issue で言及されている inspect_request の処理から始め、IPython/core/oinspect.py の 376 行目付近にある signature の呼び出しを調べます。非常に長い文字列で遅延を再現し、その後、呼び出し可能でない値に対してなぜ signature に到達するのかを追跡します。inspect_request がその値の処理に約 30 秒を費やさなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

In VS Code, we send inspect_request to get the full value of a variable for the variables view. For a really large string (e.g., 4GB) this request can take a long time, around 30s in my testing.

I don't fully follow the code, but I did some basic testing, and most of that time is spent on this call to signature, which throws https://github.com/ipython/ipython/blob/28f76f8a2f37700f8d74e91c4a54929dc367000f/IPython/core/oinspect.py#L376. Something went wrong, since the string is not callable, so it seems we shouldn't have ended up in that function anyway. I don't know whether the problem is in ipykernel or ipython.

Let me know whether you need more details.

主要言語
Python
スター
734
フォーク
411
平均マージ
1日 2時間
マージ済み PR(30日)
9

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

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

はじめの一歩

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

ipython/ipykernel のほかの issue

ipython/ipykernel の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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