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

Tensorboard file watcher causes high CPU load #8301

Closed
roblourens opened this issue Nov 17, 2021 · 3 comments
Closed

Tensorboard file watcher causes high CPU load #8301

roblourens opened this issue Nov 17, 2021 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority perf Performance issues tensorboard Tensorboard functionality from Tensorboard extension verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

  • Open my large home folder
  • Activate the Python extension
  • CPU is totally busy for minutes with a ripgrep process

image

image

I noticed that the python extension (and jupyter) use findFiles to start a search when the extension is activated. 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.

https://github.com/microsoft/vscode-python/blob/344e98262ae39d064ff8c921ad499d524f433be1/src/client/tensorBoard/tensorBoardFileWatcher.ts#L59

Not sure what this is used for, but do you absolutely have to have that info? If so, maybe you could limit the search to run for 5s.

#8293

@karthiknadig karthiknadig changed the title Python extension starts an expensive search on activation Tensorboard file watcher causes high CPU load Nov 18, 2021
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Nov 18, 2021
@IanMatthewHuff IanMatthewHuff added the important Issue identified as high-priority label Nov 18, 2021
@IanMatthewHuff IanMatthewHuff removed their assignment Nov 18, 2021
@greazer greazer added tensorboard Tensorboard functionality from Tensorboard extension and removed needs-triage labels Nov 18, 2021
@greazer greazer self-assigned this Nov 18, 2021
@greazer greazer added bug Issue identified by VS Code Team member as probable bug perf Performance issues labels Nov 18, 2021
@greazer greazer added this to the November 2021 milestone Nov 18, 2021
@joyceerhl
Copy link
Contributor

joyceerhl commented Nov 18, 2021

That code is used to promote discoverability of the TensorBoard feature, it searches a max of two directories deep and puts up a toast when it finds a tfevent file. We have it looking two directories down because that's how far down tfevent files get created in TensorBoard tutorial code. I think we should just take out the file watcher, the perf hit isn't worth the discoverability IMO. Probably also a good time to check in on feature usage

@greazer
Copy link
Member

greazer commented Nov 18, 2021

Looking at the code, while the depth is limited, looking 2 directories deep can still result in many dirs being searched. It would be great if we could know how many users are prompted for tensorboard support because we found a tfevent file 0, 1 or 2 dirs deep. Doesn't seem like that information is readily available.

So the ONLY reason we're even doing this is to essentially let users know that tensorboard features exist, right? I.e. knowing where we found event files has no bearing on how the feature works. Is that correct? If so, then yes, it would seem that removing this search altogether would be fine.

@greazer greazer assigned amunger and unassigned greazer Nov 18, 2021
@roblourens
Copy link
Member Author

Limiting the depth will not actually help with perf currently: microsoft/vscode#137484 there is also an issue to revamp findFiles to add things like a maxDepth flag. But that can still lead to looking at lots of files, like you poitn out.

@amunger amunger modified the milestones: November 2021, January 2022 Dec 3, 2021
@amunger amunger closed this as completed Dec 10, 2021
@IanMatthewHuff IanMatthewHuff added the verified Verification succeeded label Jan 28, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2023
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 tensorboard Tensorboard functionality from Tensorboard extension verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants