Skip to content

Avoid disk scans for projects by relying on DirectoryTree from CPS #6068

@arunchndr

Description

@arunchndr

Child of #6034.

Advantage is avoid slow disk scan and can avoid temp files from being picked up into the glob and thereby triggering an evaluation of the same (This also causes unwanted UI tree changes).

CPS scans the project cone directory and maintain an in-memory copy of it. If in-VS msbuild evaluation can use the virtual directory state to resolve globbing, it will cutdown time to hit disk, especially during project changes. It will also eliminate some bugs, when globbing picks up temporary file, because the project system and msbuild evaluation doesn’t have a good way to align the disk state when evaluation happens.

[ladipro] Notes from initial investigation:

  • MSBuild already supports passing a file system abstraction called MSBuildFileSystemBase to EvaluationContext.Create.
  • MSBuild currently does not expose the default implementation of MSBuildFileSystemBase so the caller has to provide all functionality by implementing all abstract methods.
    • File enumeration and existence checks, something we want to be getting from CPS.
    • File reads, something that should stay in MSBuild.
  • MSBuildFileSystemBase was created with future needs in mind and some of the functions are not currently used.

Tasks:

  • Make it possible for CPS and other callers to override only a subset of the file system callbacks (size:1).
  • Estimate the perf impact of resolving globs using CPS in-memory state.
  • Define the interface between CPS and MSBuild.
  • Provide CPS DirectoryTree via EvaluationContext for msbuild
  • Build an adapter between MSBuildFileSystemBase and IProjectTree in CPS (size:3).

Metadata

Metadata

Assignees

Labels

Area: PerformancePriority:1Work that is critical for the release, but we could probably ship withouttriaged

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions