ipython / ipython/ipykernel

inspect_request on a very large string is extremely slow

未關閉
#1,033 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
734
分支
412
平均合併
1 天 5 小時
30 天內合併 PR
8

描述

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.

貢獻指南

開啟貢獻指南

研究方向

Start at the inspect_request handling mentioned in the issue and inspect the linked signature call in IPython/core/oinspect.py around line 376. Reproduce the delay with a very large string, then trace why signature is reached for a non-callable value. Done means inspect_request no longer spends about 30 seconds processing that value.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
jupyter, python
領域
api, backend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。