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 extension starts an expensive workspace search on activation #8293

Closed
LiveFreeAndRoam opened this issue Nov 17, 2021 · 11 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority perf Performance issues verified Verification succeeded
Milestone

Comments

@LiveFreeAndRoam
Copy link

I raised this issue in remote-ssh, but turns out the evidence indicates it is an issue in Jupyter Notebook.

Please see: microsoft/vscode-remote-release#5904

In brief...

Jupyter search is following circular symlinks. This tells me it is ignoring my setting for "search.exclude". I am now going to be trying "search.followSymlinks": false. Does Jupyter honor that setting?

If not, how can I tell Jupyter to exclude search directories or not to follow symlinks?

FWIW, this is also an issue in Pylance (microsoft/pylance-release#1939), where I had to create a pyrightconfig.json file and duplicate my "search.exclude" setting.

It would be far better if all extensions honored some global setting, otherwise I'll be chasing this type of issue forever.

Environment data

  • VS Code version: 1.62.2
  • Jupyter Extension version (available under the Extensions sidebar): v2021.10.1101450599
  • Python Extension version (available under the Extensions sidebar): v2021.11.1422169775
  • OS (Windows | Mac | Linux distro) and version: Windows 10
  • Python and/or Anaconda version: Python3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Jupyter server running: N/A

Expected behaviour

XXX

Actual behaviour

Jupyter search consumes 100% CPU as it get stuck in circular symlinks.

Steps to reproduce:

Please see: microsoft/vscode-remote-release#5904

Logs

Please see: microsoft/vscode-remote-release#5904

@rchiodo
Copy link
Contributor

rchiodo commented Nov 17, 2021

Thanks for the issue.

Search for notebooks is actually implemented in VS code core. Transferring the issue there.

@rchiodo rchiodo removed their assignment Nov 17, 2021
@rchiodo rchiodo transferred this issue from microsoft/vscode-jupyter Nov 17, 2021
@roblourens roblourens transferred this issue from microsoft/vscode Nov 17, 2021
@roblourens
Copy link
Member

I didn't realize that the jupyter extension was starting a search through the entire workspace:

const findFilesPromise = this.workspace.findFiles('**/*.ipynb');

Please don't do this unless absolutely necessary, searches can be very expensive

@roblourens roblourens assigned DonJayamanne and unassigned roblourens and rchiodo Nov 17, 2021
@rchiodo
Copy link
Contributor

rchiodo commented Nov 17, 2021

@roblourens we use this to gather telemetry on the number of notebooks in a workspace. Is there an alternative?

@roblourens
Copy link
Member

Do you absolutely have to have that info? If so, maybe you could limit the search to run for 5s.

If I open my home folder, and activate the jupyter extension, the search runs for minutes and my machine looks like this:

image

image

extensions running searches is one of the top things that leads to people saying that vscode is "slow" or "bloated" so we really want to avoid this. I just noticed that the python extension is doing this too.

@roblourens roblourens changed the title Search follows circular symlinks, leads to 100% CPU Jupyter extension starts an expensive workspace search on activation Nov 17, 2021
@rchiodo
Copy link
Contributor

rchiodo commented Nov 17, 2021

Does VS code have this in its own telemetry (extension counts for workspaces?)

@ronglums @claudiaregio do we still use notebook count telemetry in a workspace for anything?

@roblourens
Copy link
Member

We do something to collect file counts, but it doesn't use ripgrep, has some low max count, and is careful to avoid too much system impact

@rchiodo
Copy link
Contributor

rchiodo commented Nov 17, 2021

Sounds like we can drop this then. You have an equivalent.

@rchiodo rchiodo added the important Issue identified as high-priority label Nov 17, 2021
@roblourens
Copy link
Member

I mean we don't report the number of notebooks, just total number of files

@rchiodo
Copy link
Contributor

rchiodo commented Nov 17, 2021

Could that be modified to indicate extension?

@roblourens
Copy link
Member

Probably wouldn't count on it

@ronglums
Copy link
Contributor

I'll let @claudiaregio comment on whether this data point is still in use.

@greazer greazer added bug Issue identified by VS Code Team member as probable bug perf Performance issues telemetry labels Nov 18, 2021
@amunger amunger closed this as completed Dec 1, 2021
@DonJayamanne DonJayamanne added the verified Verification succeeded label Dec 1, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority perf Performance issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants