Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter: Variables explorer extremely slow for certain data types #15838

Open
2 tasks done
ejohnsson6 opened this issue Jul 9, 2024 · 1 comment
Open
2 tasks done
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug variable-explorer

Comments

@ejohnsson6
Copy link

ejohnsson6 commented Jul 9, 2024

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

The following cell runs in < 1s and show up instantly in the variables explorer.

import numpy as np

bla = np.random.rand(10000000, 10)

This also runs in < 1s. However, it takes several minutes for bla2 to show up in the variables explorer.

import numpy as np

bla = np.random.rand(10000000, 10)
bla2 = [i for i in bla]

While the variable explorer is loading, all further cell executions are blocked
image

Logs don't show much. If the varaibles window is closed all is fast again.

I'm geussing the reason it is so slow is because it's fetching more metadata if it's a list and not a numpy array? Would be awesome if it was possbile to disable this for lists above a certain size. Even having the option to disable showing lists and dicts in the variable explorer would be preferable as it currently takes 10 min to rerun cells.

The problem is also present for dicts.

import numpy as np

bla = np.random.rand(10000000, 10)
bla2 = {i[0]: i[1] for i in bla}

VS Code Version

1.91.0-insider

Jupyter Extension Version

v2024.6.2024070901 (pre-release)

Jupyter logs

N/A

Coding Language and Runtime Version

python 3.12.4

Language Extension Version (if applicable)

v2024.11.2024070901 (pre-release)

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

@ejohnsson6 ejohnsson6 added the bug Issue identified by VS Code Team member as probable bug label Jul 9, 2024
@ejohnsson6 ejohnsson6 changed the title Jupyter: Variables extremely slow for certain data types Jupyter: Variables explorer extremely slow for certain data types Jul 9, 2024
@ejohnsson6
Copy link
Author

Adding "jupyter.variableExplorerExclude": "module;function;builtin_function_or_method;list;dict" to the settings is a temp fix to make it usable while working with large lists/dicts. But obviously not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug variable-explorer
Projects
None yet
Development

No branches or pull requests

4 participants