Skip to content

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

Closed

Description

  • 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!

Activity

  1. added
    important
    freeze-slow-crash-leak
    on Aug 2, 2016
  2. bpasero commented on Aug 6, 2016

    @bpasero
    Contributor

    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.

  3. 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
  4. bpasero commented on Aug 9, 2016

    @bpasero
    Contributor

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

  5. removed
    important
    on Aug 9, 2016
  6. bpasero commented on Aug 12, 2016

    @bpasero
    Contributor

    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.

  7. joaomoreno commented on Aug 15, 2016

    @joaomoreno
    Contributor

    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

  8. 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
  9. bpasero commented on Aug 15, 2016

    @bpasero
    Contributor

    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.

  10. added
    bug
    on Aug 17, 2016
  11. bpasero commented on Aug 20, 2016

    @bpasero
    Contributor

    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.

  12. added
    verified
    on Sep 1, 2016
  13. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugfreeze-slow-crash-leakverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions