Skip to content

Performance issue when running CLI in project with pnpm on Windows #1781

@Methuselah96

Description

@Methuselah96

Environments:

  • CSharpier Version: 1.2.3
  • Running CSharpier via: dotnet cli
  • Operating System: Windows
  • .csharpierrc Settings: N/A
  • .editorconfig Settings: N/A

Steps to reproduce:

Run dotnet csharpier format . on Windows in a project that uses pnpm with a large number of packages.

Expected behavior:

Formats in a reasonable amount of time

Actual behavior:

Takes about 5 minutes to run formatting.

I've narrowed the issue down to the call to .EnumerateFiles() in HasMismatchedCliAndMsBuildVersions.Check(). Running CSharpier with the --no-msbuild-check gets rid of the performance issue, and runs in 2-3 seconds instead of 5 minutes, but it'd be nice to not have to pass that flag when using the tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions