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

Explorer can freeze for large folders and many glob patterns #9962

Closed
PowerSnail opened this issue Jul 29, 2016 · 6 comments
Closed

Explorer can freeze for large folders and many glob patterns #9962

PowerSnail opened this issue Jul 29, 2016 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues verified Verification succeeded
Milestone

Comments

@PowerSnail
Copy link

  • VSCode Version: 1.3.1
  • OS Version: Windows 10 Pro

Steps to Reproduce:

  1. Open a folder from visual studio code
  2. In the sidebar, select a subfolder with a huge number of files (mine has over 70000 json files)

Then the window will just freeze. No response to click or keyboard whatsoever, until after a while the system reports that "The Window is no longer responding".

Thank you!

@kieferrm kieferrm added important Issue identified as high-priority freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues labels Aug 2, 2016
@bpasero bpasero assigned joaomoreno and unassigned bpasero Aug 6, 2016
@bpasero
Copy link
Member

bpasero commented Aug 6, 2016

Tree performance... I have seen this as well when opening the typescript workspace where they have one test folder with many thousand files. Maybe worth looking into a performance trace there to see what can be done.

@bpasero bpasero added this to the August 2016 milestone Aug 6, 2016
@bpasero bpasero self-assigned this Aug 6, 2016
@bpasero bpasero changed the title Freezes when opening a subfolder from the sidebar with many files in it Performance: explorer freezes when expanding folder with many files Aug 9, 2016
@bpasero
Copy link
Member

bpasero commented Aug 9, 2016

This cannot be important because we shipped with this for years.

@bpasero bpasero removed the important Issue identified as high-priority label Aug 9, 2016
@bpasero
Copy link
Member

bpasero commented Aug 12, 2016

When I open the tests/baseline folder of the TypeScript workspace (it includes 18000 files) it takes 30 seconds to show the contents (not seeing any progress during which, filed #10459).

@joaomoreno most time seems to be spend in the treeModel#Item() function, can you take a look? The profile is here: explorer.cpuprofile.zip

One thing to note is that the explorer is not using templates yet but I would not expect that to be a problem for 18.000 elements where most of them show hidden. Only a problem when quickly scrolling through the results.

@joaomoreno joaomoreno removed their assignment Aug 15, 2016
@joaomoreno
Copy link
Member

Just comment out this section and you'll get rid of the UI performance bottleneck. And obviously so: every filter call is going through all the sibling files, for every file, making this O(n²).

It immediately becomes more responsive, although it still takes ~5 seconds on my machine. Most of that time is spent on the file service and the file viewer classes:

screen shot 2016-08-15 at 12 53 10

@bpasero bpasero changed the title Performance: explorer freezes when expanding folder with many files Explorer can freeze for large folders and many glob patterns Aug 15, 2016
@bpasero bpasero modified the milestones: Backlog, August 2016 Aug 15, 2016
@bpasero
Copy link
Member

bpasero commented Aug 15, 2016

I pushed a fix that avoids the O(n^2) issue for most cases but if the user has configured a filter pattern where I need to know the siblings ("**/*.js": { "when": "$(basename).ts" }) we still run into the performance issue, so I am leaving this open.

@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Aug 17, 2016
@bpasero
Copy link
Member

bpasero commented Aug 20, 2016

Pushed another fix to ignore glob patterns that need to check on siblings when the number of files in a folder exceed a threshold.

Expanding the typescript/test/baseline folder with 16.000 files still takes 3-4 seconds but is much better compared to the 30-60 seconds we used to have. Closing.

@bpasero bpasero closed this as completed Aug 20, 2016
@bpasero bpasero modified the milestones: August 2016, Backlog Aug 20, 2016
@octref octref added the verified Verification succeeded label Sep 1, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
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 freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants