You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce allocations during SourceGeneration (#78403)
SourceGenerator.DoGenerate was previously writing the text into a StringBuilder, wrapping that in a TextReader, and creating a SourceText from that. Creation of that source text would end up allocating in SourceText.From (likely from calling ReadToEnd in the give text reader)
Instead, we can use a copy of the (unused) StringBuilderText and just use that as the source text.
0 commit comments