Skip to content

perf: move IsGeneratedCodeFile to Cli project and use Path(Span) methods - #1899

Open
TimothyMakkison wants to merge 1 commit into
belav:mainfrom
TimothyMakkison:is_generated_code_file
Open

perf: move IsGeneratedCodeFile to Cli project and use Path(Span) methods#1899
TimothyMakkison wants to merge 1 commit into
belav:mainfrom
TimothyMakkison:is_generated_code_file

Conversation

@TimothyMakkison

@TimothyMakkison TimothyMakkison commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description

  • Move IsGeneratedCodeFile method into CSharpier.Cli as its the only project that calls it (and is .NET only avoiding the need for preprocessors)
  • Change the method signature to IsGeneratedCodeFile(ReadOnlySpan<char> filePath), this is subtle, but it lets the methods like Path.GetFileName use the ReadOnlySpan<char> overload so this entire method goes from allocating several substrings to allocating zero objects

Profiling Check of the Csharpier repo

image

Related Issue

#1898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant