You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Explorer can freeze for large folders and many glob patterns #9962
bugIssue identified by VS Code Team member as probable bugfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesverifiedVerification succeeded
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".
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.
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[/+]on Aug 9, 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).
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.
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:
changed the title [-]Performance: explorer freezes when expanding folder with many files[/-][+]Explorer can freeze for large folders and many glob patterns[/+]on 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.
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.
bugIssue identified by VS Code Team member as probable bugfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesverifiedVerification succeeded
Activity
bpasero commentedon 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.
[-]Freezes when opening a subfolder from the sidebar with many files in it[/-][+]Performance: explorer freezes when expanding folder with many files[/+]bpasero commentedon Aug 9, 2016
This cannot be important because we shipped with this for years.
bpasero commentedon 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).
João Moreno (@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 commentedon Aug 15, 2016
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:
less work guessing mime types (for #9962)
do not resolve siblings unless needed (for #9962)
[-]Performance: explorer freezes when expanding folder with many files[/-][+]Explorer can freeze for large folders and many glob patterns[/+]bpasero commentedon 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.workaround for explorer freeze (for #9962)
bpasero commentedon 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.