ipython / ipython/ipykernel

inspect_request on a very large string is extremely slow

Đang mở
#1,033 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
734
Fork
412
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
8

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
jupyter, python
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.