ipykernel icon indicating copy to clipboard operation
ipykernel copied to clipboard

inspect_request on a very large string is extremely slow

Open roblourens opened this issue 3 years ago • 0 comments

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.

roblourens avatar Nov 26 '22 00:11 roblourens