Skip to content

Conversation

@faddiv
Copy link
Contributor

@faddiv faddiv commented Dec 30, 2025

Optimize source generation by using GetText

Description

This is a small improvement I wished to send in for a while:
This way of the source text generation is better, since it internally contains a decision: if the output size is larger than the Large Object Heap limit, then it uses LargeTextWriter, which breaks the source apart, so the LOH allocation is avoided. On the benchmark, there is no visible change, but I think it is worth it.

Fixes # (issue)

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code
  • Hard-to-understand areas of my code are commented
  • The documentation is updated (as applicable)
  • Unit tests are added/updated
  • Integration tests are added/updated (as applicable, especially if feature/bug depends on roslyn or framework version in use)

@latonz latonz added the enhancement New feature or request label Dec 30, 2025
@latonz latonz changed the title Optimize source generation by using GetText feat: Optimize source generation by using GetText Dec 30, 2025
Copy link
Contributor

@latonz latonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely worth it, thanks for the contribution! ❤️

@latonz latonz merged commit ad79232 into riok:main Dec 30, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants