Skip to content

Not checking files.exclude during the initial directory iteration can make the extension unusably slow for large folders #3123

Closed

Description

I added a symlink to a huge folder with hundreds of thousands of subfolders. Even though the symlink is added to the files.exclude, all the folders are still being iterated over, making everything too slow, particularly if recursive includes are used (because takes "forever" to iterate through all the folders). I don't know how common this is. The root problem is that we're not checking folder exclusions when we generate our initial list of directory entries, so all the subfolders of excluded folders are still added, and later every folder ends up checking checked against the files.exclude, which is expensive. As a workaround, I'm removing the symlink to the large folder.

Activity

  1. ThadHouse commented on Feb 3, 2019

    @ThadHouse

    One thing I want to make sure of is I have an extension and a large scale project that doesn't use symlinks, but uses the API provider where some of the provided headers are in a files.exclude folder. This seems pretty common too, especially with things like generated headers in something like a CMake build, where the generated file gets placed in the build folder. I want to make sure a fix for this does not break that workflow, as that is very important to us, and likely others. Want to make sure both go to definition and full intellisense still works as well.

  2. sean-mcmanus commented on Feb 4, 2019

    @sean-mcmanus
    ContributorAuthor

    Hmm...we already have files.exclude checkers that avoid parsing those files, but we apply the exclude filter after the huge list of folders is already generated (i.e. checking for exclusion on 100k folder unnecessarily). So Go to Definition on a target in a files.exclude folder or recursive includes for folders matching a files.exclude is not expected to work currently. Maybe we could use search.exclude or add a new intelliSense.exclude setting.

  3. terrisgit commented on Aug 3, 2019

    @terrisgit

    Given that I check my .vscode directory into git, I'd rather put 'excludes' in c_cpp_properties.json (See https://github.com/microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/c_cpp_properties.json.md).

    For now (but this doesn't work due to this bug), you're supposed to add patterns via Preferences/Settings .. then search for "exclude".

  4. jinay1991 commented on Oct 17, 2019

    @jinay1991

    I had the exact same issue and after setting files.watcherExclude it stopped consuming CPU. Although I have a feeling that it is more of the VSCode issue instead of this plugin as even with NO PLUGIN installed, behaviour was same until I set files.watcherExclude.

    The process consuming CPU was watcherHelper

  5. 4 remaining items

  6. changed the title [-]Adding a symlink to a huge folder makes the extension unusably slow (even with files.exclude)[/-] [+]Not checking files.exclude during the initial directory iteration can make the extension unusably slow for for large folders[/+] on Aug 13, 2020
  7. changed the title [-]Not checking files.exclude during the initial directory iteration can make the extension unusably slow for for large folders[/-] [+]Not checking files.exclude during the initial directory iteration can make the extension unusably slow for large folders[/+] on Aug 13, 2020
  8. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Apr 5, 2021
  9. michelleangela commented on Apr 14, 2021

    @michelleangela
    Contributor

    Fix is released in the 1.3.0 release version https://github.com/microsoft/vscode-cpptools/releases/tag/1.3.0

  10. locked and limited conversation to collaborators on May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions