Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: Do not call CSharpCompilation.Clone #16249

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Apr 18, 2024

Despite what the original comment said, calling CSharpCompilation.Clone actually makes the extractor consume more memory instead of less memory, at least when running in buildless mode, where all .cs files are included in one single compilation.

Running buildless extraction on dotnet/roslyn locally with /usr/bin/time -l reported a maximum resident set size of 51,035,299,840 before this PR and 15,477,882,880 after.

DCA confirms that this is an improvement, as the database build time for mono/mono and OrchardCMS/OrchardCore decrease by 70% in buildless mode.

@github-actions github-actions bot added the C# label Apr 18, 2024
@hvitved hvitved changed the title C#: Do no call CSharpCompilation.Clone C#: Do not call CSharpCompilation.Clone Apr 18, 2024
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Apr 19, 2024
@hvitved hvitved marked this pull request as ready for review April 19, 2024 11:31
@hvitved hvitved requested a review from a team as a code owner April 19, 2024 11:31
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

Wow - neat! Friday Win!

@hvitved hvitved merged commit 57796d6 into github:main Apr 19, 2024
16 checks passed
@hvitved hvitved deleted the csharp/no-compilation-clone branch April 19, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants