Skip to content

Performance issues when supporting .gitignore. #1588

Closed
@belav

Description

@belav

I believe there are two major performance issues with the support for .gitignore.

CSharpier formats files in parallel. Currently multiple threads will create the exact same IgnoreFile objects in memory. The constructors for those objects are one of the two major hotspots when profiling. Look into using an approach similiar to https://github.com/RyanLamansky/dotnet-shared-action/tree/main for only doing that work a single time.

CSharpier evaluates every rule across all relevant .gitignore files for each file that may need to be formatted. IgnoreRule.IsMatch is the other major hotspot.

  • Is it possible to narrow down the list of rules that need to be evaluated?
  • Is it possible to optimize the evaluation of rules?
    • CSharpier currently uses a nuget library for the ignore file rules that uses regex. How do other languages implement ignore file rules?

Should this feature stay removed? Opt in? Opt out?

Re-enable/cleanup tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions